I am trying to display icon file in a picture box. I\'m using this code to set the image.
icon file
pictureBox1.Image = new Icon(openFileDialog.FileName,
Some icons are sized incorrectly 48x48 to 32x32.
My final code is:
Bitmap _image; try { _image = new Icon(icon, width, height).ToBitmap(); } catch(ArgumentOutOfRangeException) { _image = Bitmap.FromHicon(new Icon(icon, new Size(width, height)).Handle); }