I wrote the below code to convert a small bitmap image to a Windows Icon. The code creates an Image object from a the BMP-format file. It then saves the Image object to disk, specifying Windows Icon format. Unfortunately, for some reason instead of it being
in ICO format, it seems to save it in PNG format!?! [code] System.Drawing.Image myImage = System.Drawing.Image.FromFile(Server.MapPath("test.bmp")); myImage.Save(Server.MapPath("myicon.ico"), System.Drawing.Imaging.ImageFormat.Icon); myImage.Dispose(); [/code]
I must be doing something wrong, but I cannot understand what. I state clearly in the code that I want to save "myicon.ico" as an ImageFormat.Icon file, so I have no clue as to why it keeps saving my "myicon.ico" file in PNG format! Any help is appreciated.
webmastersdo...
Member
15 Points
3 Posts
Saving an image as ICO ends up as a PNG?
Jan 25, 2004 09:17 PM|LINK
webmastersdo...
Member
15 Points
3 Posts
Re: Saving an image as ICO ends up as a PNG?
Jan 25, 2004 10:55 PM|LINK