PC Review


Reply
Thread Tools Rate Thread

APPARENT **NASTY BUG** IN CF 2.0

 
 
=?Utf-8?B?ZGVybWl0ZQ==?=
Guest
Posts: n/a
 
      28th Sep 2005
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
 
Reply With Quote
 
 
 
 
Nick Randolph
Guest
Posts: n/a
 
      1st Oct 2005
Dermite

Just did a quick test with your code (which looks ok to me) in the RC1 build
I have for VS and I experience the same issue. I would say that this
"feature" is here to stay at this point for v2.0. I would suggest that this
goes forward as a recommendation for SP1 for the .NET CF v2.0 as I would
suggest that being able to save to jpg would be desirable for a number of
developers.

Nick
"dermite" <(E-Mail Removed)> wrote in message
news:74966DB8-C4FE-44E7-AA49-(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?ZGVybWl0ZQ==?=
Guest
Posts: n/a
 
      2nd Oct 2005
Thank you for this. I was wondering whether the problem might be fixed in RC1.

There was another response to my query, which for some reason has been
deleted from the thread. This indicated that it is likely to be a platform
issue, rather than a CF issue. That is, the Windows Mobile 5.0 Pocket PC
platform may not support writing JPEG's. In this case, it could not be done
in native code, e.g. with the Imaging API.

It would be nice if we could get some comment from Microsoft, so we would
really know what is going on.

If the problem is a CF limitation, rather than a platform limitation, I
could use a combination of the Imaging API and CryptoAPI, in native code.
Instead, I have assumed the other comment was correct, and that the platform
does not support JPEG writing. So, I am using the Independent JPEG Group's
library with the CryptoAPI, in native code.

dermite


"Nick Randolph" wrote:

> Dermite
>
> Just did a quick test with your code (which looks ok to me) in the RC1 build
> I have for VS and I experience the same issue. I would say that this
> "feature" is here to stay at this point for v2.0. I would suggest that this
> goes forward as a recommendation for SP1 for the .NET CF v2.0 as I would
> suggest that being able to save to jpg would be desirable for a number of
> developers.
>
> Nick
> "dermite" <(E-Mail Removed)> wrote in message
> news:74966DB8-C4FE-44E7-AA49-(E-Mail Removed)...
> >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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could Have Been VERY Nasty nivrip General Discussion 5 4th Aug 2008 04:39 PM
SEEMS I HAVE GOT SOMETHING NASTY ON MY XP IE6 =?Utf-8?B?R09a?= Windows XP Internet Explorer 1 6th Dec 2005 07:28 PM
Nasty bug =?Utf-8?B?SmlueGVk?= Windows XP General 6 9th Mar 2005 07:41 AM
Nasty Bug? =?Utf-8?B?a2VuNDc=?= Windows XP Security 1 16th Aug 2004 07:43 AM
Nasty 1202 Warning and no apparent fix! =?Utf-8?B?QmlsbA==?= Microsoft Windows 2000 Group Policy 2 3rd Jun 2004 09:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:05 PM.