Icon not saving in correct format
-
I am trying to save an image from a PictureBox to an icon file, but I'm having two problems. 1. When saving the image to an icon, (.ico and
ImageFormat.Icon
) it saves but it gets an "Unknown File Type" icon instead of it's own. But if I save it as a bitmap, (.ico andImageFormat.Bmp
) it saves and displays fine. Why is this? Shouldn't it be the other way around? 2. No matter which format I save the icon in, when trying to open it in a icon editor I get an error saying either: "Not An Icon File" or "Invalid Icon Header File". I have done plenty of research and every site I found says to save an icon the same way I am. Which is:Dim IconImg As Bitmap
IconImg = ImgBox.Image
IconImg.Save("C:\Image.ico", System.Drawing.Imaging.ImageFormat.Icon)What am I missing? Thanks for the help!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
I am trying to save an image from a PictureBox to an icon file, but I'm having two problems. 1. When saving the image to an icon, (.ico and
ImageFormat.Icon
) it saves but it gets an "Unknown File Type" icon instead of it's own. But if I save it as a bitmap, (.ico andImageFormat.Bmp
) it saves and displays fine. Why is this? Shouldn't it be the other way around? 2. No matter which format I save the icon in, when trying to open it in a icon editor I get an error saying either: "Not An Icon File" or "Invalid Icon Header File". I have done plenty of research and every site I found says to save an icon the same way I am. Which is:Dim IconImg As Bitmap
IconImg = ImgBox.Image
IconImg.Save("C:\Image.ico", System.Drawing.Imaging.ImageFormat.Icon)What am I missing? Thanks for the help!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
Thanks, but that involves drastically editing my code, and it saves the icons in 16-bit colors instead of 32-bit (and I can't figure out why). Is there another way? Thanks anyway!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.