Home > Net >  How do I choose more than an icon in the icon file size?
How do I choose more than an icon in the icon file size?

Time:03-01

Icon file with the icon of a single size, there are many different sizes (also may have the same size) icon to save in an icon file, for the latter if I can choose?
Read the following code is an icon file, then displayed in the picture box code, but it can't identify the target icon file is a single figure or photos, also can't choose, ask how to identify multiple icon and select one of the pieces to display,
 
Private void button1_Click (object sender, EventArgs e)
{
DialogResult Dr=openFileDialog1. ShowDialog (this);
If (Dr==DialogResult. OK)
{
The string filename=openFileDialog1. Filename;
Icon picicon=Icon. ExtractAssociatedIcon (filename);
Image picimage=picicon. ToBitmap ();
PictureBox1. Image=picimage;
}
}

CodePudding user response:

https://blog.csdn.net/zgke/article/details/3279327
Is this you want?
  •  Tags:  
  • C#
  • Related