Sto tentando di visualizzare icon file
in una finestra di immagine. Sto usando questo codice per impostare l'immagine.Visualizzazione di un'icona in una casella immagine
pictureBox1.Image = new Icon(openFileDialog.FileName, new Size(48, 48)).ToBitmap();
Ma sto ottenendo questa eccezione.
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()
Come superare questo problema?
Grazie.
Questo è quello che ho trovato. Grazie comunque. –