Bitmap.Save not supported in CF 2.0?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Folks,

I understand that Bitmap.Save() was not supported in earlier versions of the
CF, but my understanding was that it is supported in 2.0. However, I get a
NotSupportedException with Bitmap.Save(). Specifically I am trying to do
something like Bitmap.Save(String filename, ImageFormat.Jpeg). I am using VS
2005 beta 2 with the emulator. The documentation that comes with VS shows
that Bitmap.Save() should be supported in the CF. System.Environment.Version
is reported as 2.0.50560.0 from my application running on the emulator. What
gives?

Thanks,

Matthew Fleming
 
The Image.Save method works for ImageFormat.Bmp value (tested for Pocket
PC 2003 SE). I suspect that this is not CF.NET restriction but OS and
probably the internal method IsSupportedImageFormat@AGL somehow conneted
with Imaging API that returns false on all other format except Bmp which
subsequently throws NotSupportedException.
 
Sergey,

Thank you so much for this very informative response. Evidently the problem
then would be a limitation in Windows Mobile 5.0, rather than the .NET CF
2.0. The next question might be, is there any possibility that it would work
on an actual WM 5.0 device, even though it doesn't work on the emulator? My
assumption would be, no, but I don't have a WM 5.0 device at the moment for
testing. Also, if the limitation is in the Imaging API itself, then nothing I
can do with P/Invoke would solve the problem. The only solution would be to
bring in a third party library, such as the Independent JPEG Group's library,
to write the jpegs. I have used this library for writing (and reading) JPEG's
on the PPC in the past.

Thanks again,

Matthew Fleming

Sergey Bogdanov said:
The Image.Save method works for ImageFormat.Bmp value (tested for Pocket
PC 2003 SE). I suspect that this is not CF.NET restriction but OS and
probably the internal method IsSupportedImageFormat@AGL somehow conneted
with Imaging API that returns false on all other format except Bmp which
subsequently throws NotSupportedException.


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

Folks,

I understand that Bitmap.Save() was not supported in earlier versions of the
CF, but my understanding was that it is supported in 2.0. However, I get a
NotSupportedException with Bitmap.Save(). Specifically I am trying to do
something like Bitmap.Save(String filename, ImageFormat.Jpeg). I am using VS
2005 beta 2 with the emulator. The documentation that comes with VS shows
that Bitmap.Save() should be supported in the CF. System.Environment.Version
is reported as 2.0.50560.0 from my application running on the emulator. What
gives?

Thanks,

Matthew Fleming
 
Back
Top