Conversion from Bitmap to Icon in GDI+
-
Hello everybody! I would like to convert a Bitmap object (System.Drawing.Bitmap) to an Icon object (System.Drawing.Icon). I tried to use IconConverter class and ImageConverter class:
ImageConverter ic = new ImageConverter();
Icon i = (Icon)ic.ConvertTo(bitmap,Icon.GetType());I got an exception:
An unhandled exception of type 'System.NotSupportedException' occurred in system.windows.forms.dll
Additional information: 'ImageConverter' is unable to convert 'System.Drawing.Bitmap' to 'System.Drawing.Icon'.
Help me, please!
Ñ There is only one MP Ð
-
Hello everybody! I would like to convert a Bitmap object (System.Drawing.Bitmap) to an Icon object (System.Drawing.Icon). I tried to use IconConverter class and ImageConverter class:
ImageConverter ic = new ImageConverter();
Icon i = (Icon)ic.ConvertTo(bitmap,Icon.GetType());I got an exception:
An unhandled exception of type 'System.NotSupportedException' occurred in system.windows.forms.dll
Additional information: 'ImageConverter' is unable to convert 'System.Drawing.Bitmap' to 'System.Drawing.Icon'.
Help me, please!
Ñ There is only one MP Ð
I wrote a utility to do this one time. Check out the source for a quick solution on how to do this. http://www.prism.gatech.edu/~gte477n/languages/csharp/converter.html[^] Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n
-
I wrote a utility to do this one time. Check out the source for a quick solution on how to do this. http://www.prism.gatech.edu/~gte477n/languages/csharp/converter.html[^] Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n
Thanks!
Ñ There is only one MP Ð