Groups | Blog | Home
all groups > dotnet compact framework > august 2006 >

dotnet compact framework : exception


Erwin Zwart
8/27/2006 4:15:45 PM
As i am i dummy user trying to debug a dummy application i've got a
exception thrown at a very basic piece of code:

public static Image LoadImage( string Filename )
{
try
{
Image img = new Bitmap( Filename );
return img;
}
catch { }

return null;
}

"A first chance exception of type 'System.InvalidCastException' occurred in
System.Drawing.dll" is thrown at
Image = img new Bitmap( Filename) where filename is a string which indicates
the picturename and path. thi

Seems good code to me,
I also tried it with a bitmap and also tried to cast it to an Image object,
but same exception.

I am targeting a I-mate Windows Mobile5 device,

Is this normal behaviour?!?


Many thanks in advance,

Eddy

baby123
8/27/2006 10:59:16 PM
try to check image format...
AddThis Social Bookmark Button