Results 1 to 7 of 7

Thread: [2003] Icon only saved as 16 colors?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Unhappy [2003] Icon only saved as 16 colors?

    I am trying to convert a BMP to an icon, and all goes well, however it is only saved with 16 colors . The method I am using:
    VB Code:
    1. Dim MyBMP As New Bitmap(MyPictureBox.Image)
    2.             Dim MyIcon As Icon = Icon.FromHandle(MyBMP.GetHicon)
    3.             Dim st As System.IO.Stream = New System.IO.FileStream(MyFileName, IO.FileMode.Create)
    4.             Dim wr As New System.IO.BinaryWriter(st)
    5.             MyIcon.Save(st)
    6.             wr.Close()
    When testing a JPG with lots of colors as the source image, the resulting Icon is saved with only 16 colors, so the image looks all screwey. Is there a way to go about changing the format to support 16 bit or 32 bit color? Or at least 256? Another method perhaps? I checked the Icon class and there doesnt seem to be much there...

    ***Note - if you want to test, make sure your original image is 16x16 or 32x32... an attached 32x32 image (of yours truly ) is included in the attachments if you dont feel like making one, as well as the ugly result that shows...
    Attached Images Attached Images   
    Last edited by gigemboy; Mar 29th, 2006 at 12:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width