Próbuję wyświetlić icon file
w ramce graficznej. Używam tego kodu do ustawienia obrazu.Wyświetlanie ikony w skrzynce obrazkowej
pictureBox1.Image = new Icon(openFileDialog.FileName, new Size(48, 48)).ToBitmap();
Ale otrzymuję ten wyjątek.
System.ArgumentOutOfRangeException: Requested range extends past the end of the array.
at System.Runtime.InteropServices.Marshal.CopyToNative(Object source, Int32 startIndex, IntPtr destination, Int32 length)
at System.Runtime.InteropServices.Marshal.Copy(Byte[] source, Int32 startIndex, IntPtr destination, Int32 length)
at System.Drawing.Icon.ToBitmap()
Jak przezwyciężyć ten problem?
Dzięki.
To co znalazłem. Dzięki i tak. –