I now get a 'NotSupportedException' when using the Icon constructor
that takes a Stream.

Here is the C# code that is used.

//Img = new Icon( System.IO.File.Open( "\\first.ico",
System.IO.FileMode.Open ) );

Stream stream =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("FMRS.Images.icon_first.ico");

Icon icon = new Icon(stream);
imgListReading.Images.Add(icon);

I have checked that the stream is not null.

This is the error I get...

An unhandled exception of type 'System.NotSupportedException' occurred
in System.Drawing.dll

Additional information: NotSupportedException

Re: Can not Construct Icon From stream. by Fabien

Fabien
Fri Sep 29 08:12:03 CDT 2006

Hi,

If you use the CF1.0, try to install the SP3 :
http://www.microsoft.com/downloads/details.aspx?FamilyID=3Da5a02311-194b-4c=
00-b445-f92bec03032f&displaylang=3Den


BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/



steel a =E9crit :

> I now get a 'NotSupportedException' when using the Icon constructor
> that takes a Stream.
>
> Here is the C# code that is used.
>
> //Img =3D new Icon( System.IO.File.Open( "\\first.ico",
> System.IO.FileMode.Open ) );
>
> Stream stream =3D
> System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStre=
am("FMRS.Images.icon_first.ico");
>
> Icon icon =3D new Icon(stream);
> imgListReading.Images.Add(icon);
>
> I have checked that the stream is not null.
>
> This is the error I get...
>
> An unhandled exception of type 'System.NotSupportedException' occurred
> in System.Drawing.dll
>=20
> Additional information: NotSupportedException