G
Guest
I posted on this yesterday but did not get a response, so I'm trying again. I
would REALLY APPRECIATE IT if someone at Microsoft would comment on this, as
I am fairly sure that the problem is not just a manifestation of my innate
stupidity.
Searching the web produces much confirmation that Bitmap.Save was absent
from CF 1.0, that it was greatly missed, and that it was to be added in CF
2.0. Also, my VS 2005 beta 2 documentation indicates that Bitmap.Save is
supported in the CF. (Specifically, when I look up the Bitmap Members, and
click on Save, I am directed to a page titled "Image.Save" with various
overloads, including the following:
Image.Save(String,ImageFormat) Saves this Image object to the specified
file in the specified format. Supported by the .NET Compact Framwork.
When I look up ImageFormat's members, 4 have little handheld icons
associated with them: Bmp, Gif, Jpeg and Png. However, these do not have the
text "Supported by the .NET Compact Framework".
Now consider the following simple code:
MessageBox.Show(System.Environment.Version.ToString());
Bitmap bmp = new Bitmap(100, 100);
bmp.Save("bmp.jpg", ImageFormat.Jpeg);
When this is run on the desktop, of course no problem. When it is run on the
Pocket PC Magneto emulator that came with VS 2005 beta 2, the last line
produces the following exception:
"An unhandled exception of type 'System.NotSupportedException' occurred in
System.Drawing.dll. Additional information: NotSupportedException". The
first line displays the CF version, which is 2.0.5056.0."
Now, it turns out that the same problem occurs with ImageFormat.Gif and
ImageFormat.Png, as well as ImageFormat.Jpeg, but NOT with ImageFormat.Bmp.
Thus it seems that support was left out for all image formats other than Bmp.
Either this is a bug, or the documentation is wrong.
This is a significant problem for me. I could use PInvoke with the Imaging
API to save the images as jpeg. However, the problem is that I want to
encrypt them as they are saved. This should be easy with the C# API, as I
should be able to use Bitmap.Save(Stream, ImageFormat) with a CryptoStream,
but will be significantly more difficult if I have to do it in C++ Imaging
API with the CryptoAPI.
OK, this was a reasonably detailed bug report, if I say so myself. Could we
have a word from Microsoft as to what is going on here?
Thank you,
Matthew Fleming
would REALLY APPRECIATE IT if someone at Microsoft would comment on this, as
I am fairly sure that the problem is not just a manifestation of my innate
stupidity.
Searching the web produces much confirmation that Bitmap.Save was absent
from CF 1.0, that it was greatly missed, and that it was to be added in CF
2.0. Also, my VS 2005 beta 2 documentation indicates that Bitmap.Save is
supported in the CF. (Specifically, when I look up the Bitmap Members, and
click on Save, I am directed to a page titled "Image.Save" with various
overloads, including the following:
Image.Save(String,ImageFormat) Saves this Image object to the specified
file in the specified format. Supported by the .NET Compact Framwork.
When I look up ImageFormat's members, 4 have little handheld icons
associated with them: Bmp, Gif, Jpeg and Png. However, these do not have the
text "Supported by the .NET Compact Framework".
Now consider the following simple code:
MessageBox.Show(System.Environment.Version.ToString());
Bitmap bmp = new Bitmap(100, 100);
bmp.Save("bmp.jpg", ImageFormat.Jpeg);
When this is run on the desktop, of course no problem. When it is run on the
Pocket PC Magneto emulator that came with VS 2005 beta 2, the last line
produces the following exception:
"An unhandled exception of type 'System.NotSupportedException' occurred in
System.Drawing.dll. Additional information: NotSupportedException". The
first line displays the CF version, which is 2.0.5056.0."
Now, it turns out that the same problem occurs with ImageFormat.Gif and
ImageFormat.Png, as well as ImageFormat.Jpeg, but NOT with ImageFormat.Bmp.
Thus it seems that support was left out for all image formats other than Bmp.
Either this is a bug, or the documentation is wrong.
This is a significant problem for me. I could use PInvoke with the Imaging
API to save the images as jpeg. However, the problem is that I want to
encrypt them as they are saved. This should be easy with the C# API, as I
should be able to use Bitmap.Save(Stream, ImageFormat) with a CryptoStream,
but will be significantly more difficult if I have to do it in C++ Imaging
API with the CryptoAPI.
OK, this was a reasonably detailed bug report, if I say so myself. Could we
have a word from Microsoft as to what is going on here?
Thank you,
Matthew Fleming