S
Saya
Hello,
This is a repost 'cause I haven't solve the problem: I can't use the
System.Drawing class 'Image.FromStream' in the CompactFramework
environment. What I've done with respect to Brendan's suggestion is as
follows:
Brendan, thanks for the reply!
I'm a little bit further now, but not yet finished.
I've come this far, see code below:
Stream s =
Assembly.GetExecutingAssembly().GetmanifestResourceStream("somefile.jpg");
Bitmap b = new Bitmap(s);
return b;
I'm stuck with the part ("somefile.jpg") - don't know how to fill this
parameter.
The (working-)XP version code looks like this:
Stream str=null;
HttpRequest hReq=(HttpWebRequest)WebRequest.Create(aURL);
HttpWebResponse hRes=(HttpWebResponse)(hReq).GetResponse();
str=hRes.GetResponseStream();
return Image.FromStream(str);
Can you help more, please?
Thank you, Saya
==============================================
Previous posting:
While System.Drawing.Image does not have static FromStream() member
function
under CE, System.Drawing.Bitmap does have something similar, one of
it’s
constructors takes a System.IO.Stream as an argument. See if you can’t
use
this constructor to create a new instance of your image with the
Bitmap class.
Brendan
This is a repost 'cause I haven't solve the problem: I can't use the
System.Drawing class 'Image.FromStream' in the CompactFramework
environment. What I've done with respect to Brendan's suggestion is as
follows:
Brendan, thanks for the reply!
I'm a little bit further now, but not yet finished.
I've come this far, see code below:
Stream s =
Assembly.GetExecutingAssembly().GetmanifestResourceStream("somefile.jpg");
Bitmap b = new Bitmap(s);
return b;
I'm stuck with the part ("somefile.jpg") - don't know how to fill this
parameter.
The (working-)XP version code looks like this:
Stream str=null;
HttpRequest hReq=(HttpWebRequest)WebRequest.Create(aURL);
HttpWebResponse hRes=(HttpWebResponse)(hReq).GetResponse();
str=hRes.GetResponseStream();
return Image.FromStream(str);
Can you help more, please?
Thank you, Saya
==============================================
Previous posting:
While System.Drawing.Image does not have static FromStream() member
function
under CE, System.Drawing.Bitmap does have something similar, one of
it’s
constructors takes a System.IO.Stream as an argument. See if you can’t
use
this constructor to create a new instance of your image with the
Bitmap class.
Brendan