I would like to create a single System.Drawing.Icon programmatically from 32×32, 16×16 Bitmaps. Is this possible? If I load an icon with –
Icon myIcon = new Icon(@"C:\myIcon.ico");
…it can contain multiple images.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An .ico file can have multiple images in it, but when you load an .ico file and create an Icon object, only one of those images is loaded. Windows chooses the most appropriate image based on the current display mode and system settings and uses that one to initialize the
System.Drawing.Iconobject, ignoring the others.So you can’t create a
System.Drawing.Iconwith multiple images, you have to pick one before you create theIconobject.Of course, It is possible to create an Icon at runtime from a bitmap, is that what you are really asking? Or are you asking how to create an .ico file?