Question Icon Preview

inkedgfx

Well-known member
Joined
Sep 29, 2012
Messages
139
Location
USA
Programming Experience
Beginner
I save 1 image as an icon ...but when I ge to the folder where i saved it , there is no preview of the thumbnail...there is just a white box with the icon name ...if i open the icon the image is correct but how do I get vb to make a thumbnail preview for it when the icon is saved?

InkedGFX
 
I think you are using Image.Save with ImageFormat.Icon - that will not produce valid ico files, they are just png files with .ico extension. Doing that will also just show blank previews in Explorer, while most photo viewers will detect the actual image format based on contents and display the image.
To save real .ico format files use the Icon.FromHandle method with Bitmap.GetHIcon, then use the Icon.Save method saving to a FileStream.
 
I think you are using Image.Save with ImageFormat.Icon - that will not produce valid ico files, they are just png files with .ico extension. Doing that will also just show blank previews in Explorer, while most photo viewers will detect the actual image format based on contents and display the image.
To save real .ico format files use the Icon.FromHandle method with Bitmap.GetHIcon, then use the Icon.Save method saving to a FileStream.

thank you for your help...I tried to save the icon with the sggestions above...this method works and there is now a preview of the saved Icon, however it is extremely low res...is there anything vb can do to save this in high res?

InkedGFX
 
Back
Top