Retrieve images from WebServer

S

Saya

Hello,

I'm new to WebServices and WinCE. My first projects involves an
image retrieving Client app, running on a desktop with XP. The local
server is IIS. The images resides on the server machine (jpg, bmp
etc). The app works fine; I did it with FromStream from the
System.Drawing.Image class.
Now I need to port it to a SmartDevice (TabletPC running WinCE).
My problem is: how to create this WinCE version? Apparently there is
no equivalent of 'FromStream' for this machine.

Please advise - Thank you!

Saya
 
G

Guest

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
 
S

Saya

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

===================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top