Issue with Icon constructor in CF SP2

G

Guest

Hi All,

This seems to be a new bug that has been introduced in CF SP2.

I now get a 'NotSupportedException' when using the Icon constructor that
takes a Stream. If I do not install SP2 the constructor works fine (using PPC
2003 Phone Ed emulator).

Here is the C# code that is used.

Stream stream =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("FMRS.Images.icon_first.ico");
Icon icon = new Icon(stream); //this blows up with SP2
imgListReading.Images.Add(icon);

As I said, the code works fine without CF SP2 installed. 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
***

There is no message with the error, nor an inner exception, which is
especially nice!
 
T

Tim Wilson

What is the color depth of the images in your icon? 4-bit, 8-bit, 16-bit,
24-bit, etc?
 
M

Mark Dykun

We see this error also.

Wrap the call in a try catch block and it will still work anyways.

Mark
 
G

Guest

Thanks Mark, I'll try and log it as a bug as soon as I get a second. Seems to
be SP1, SP2 & Beta SP3 but not version 1.0....

Cheers for the help,
Sam.
 
G

Guest

Thanks Tim, I'll give that a go. I'll also report it as a bug when I get a
second (since it works ok pre SP1).

Thanks for your time,
Sam.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top