From: Mike Yeager on
I'm working on an app where I'd like to display .JPG images from a SQL CE database. Lacking Image.FomFile() and Image.FromStream() or a constructor parameter, I'm having difficulty getting this done.

Can anyone point me to an example?

Thanks,
Mike
From: Peter Foot [MVP] on
The Bitmap class has a constructor which accepts a filename or a stream e.g.

Image myimage = new Bitmap("\\My Documents\\mypicture.jpg");

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org
"Mike Yeager" <MikeYeager(a)newsgroup.nospam> wrote in message news:eckzQuuCFHA.3928(a)TK2MSFTNGP15.phx.gbl...
I'm working on an app where I'd like to display .JPG images from a SQL CE database. Lacking Image.FomFile() and Image.FromStream() or a constructor parameter, I'm having difficulty getting this done.

Can anyone point me to an example?

Thanks,
Mike
From: Mike Yeager on
Thanks for the fast response! That will work.

Mike

"Peter Foot [MVP]" <feedback(a)nospam-inthehand.com> wrote in message news:%237YzD0uCFHA.3928(a)TK2MSFTNGP15.phx.gbl...
The Bitmap class has a constructor which accepts a filename or a stream e.g.

Image myimage = new Bitmap("\\My Documents\\mypicture.jpg");

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org
"Mike Yeager" <MikeYeager(a)newsgroup.nospam> wrote in message news:eckzQuuCFHA.3928(a)TK2MSFTNGP15.phx.gbl...
I'm working on an app where I'd like to display .JPG images from a SQL CE database. Lacking Image.FomFile() and Image.FromStream() or a constructor parameter, I'm having difficulty getting this done.

Can anyone point me to an example?

Thanks,
Mike
From: Mike Yeager on
In case anyone is interested, this code seems to work:

byte[] arrPicture =
((byte[])(dsPatients.Tables["Patients"].Rows[0]["mugshot"]));
MemoryStream ms = new MemoryStream(arrPicture);
Image pic = new Bitmap(ms);
this.pictureBox1.Image = pic;


 | 
Pages: 1
Prev: Prevent backlight from auto dim
Next: Menubar