Re: Load image from DB into PictureBox control
- From: K. Wilder <KWilder@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 1 May 2005 09:54:35 -0700
Jim,
When I try the CType conversion I get the following error in my Task list:
Value of type '1-dimensional array of Byte' cannot be converted to 'Byte'.
I know it can be done. I've seen sample Northwind applications that have
done it but that was a long time ago and I never needed to know. Now I
don't remember what those applications were.
Any other ideas?
Thanks again,
King
"Jim Hughes" wrote:
> ba = CType( .Photo, Byte() )
>
> "K. Wilder" <KWilder@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:060EBEB6-0BDE-4B68-AE26-D6FDAD94ED99@xxxxxxxxxxxxxxxx
> > Tim,
> >
> > I tried your Google example and got an "Invalid parameter used" error.
> >
> > This is my code:
> >
> > Dim ba() as Byte
> > ba = .Photo
> > Dim ms As New IO.MemoryStream(ba)
> > Me.picBox.Image = Image.FromStream(ms)
> >
> > Any ideas?
> >
> > Thanks,
> >
> > King Wilder
> >
> >
> > "Tim Wilson" wrote:
> >
> >> If the image is in a Byte array then you could create a MemoryStream
> >> using
> >> this Byte array, then call the shared FromStream method of the Image
> >> class
> >> passing in the MemoryStream. There's some sample code at the link below.
> >>
> >> http://www.google.ca/groups?hl=en&lr=&selm=erQHZobLEHA.2388%40TK2MSFTNGP09.phx.gbl
> >>
> >> --
> >> Tim Wilson
> >> ..Net Compact Framework MVP
> >>
> >> "K. Wilder" <KWilder@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:36DBE9AA-58C0-4FFB-8D22-45F985F49C23@xxxxxxxxxxxxxxxx
> >> > In VB.Net, does anyone know how to load an image from, example
> >> > Northwind
> >> DB
> >> > employees table, to a picture box control?
> >> >
> >> > The Image is in Byte format and I can't figure out how to convert it to
> >> > an
> >> > image.
> >> >
> >> > Thanks,
> >> >
> >> > King Wilder
> >>
> >>
> >>
>
>
>
.
- References:
- Load image from DB into PictureBox control
- From: K. Wilder
- Re: Load image from DB into PictureBox control
- From: K. Wilder
- Re: Load image from DB into PictureBox control
- From: Jim Hughes
- Load image from DB into PictureBox control
- Prev by Date: RE: Raising Keydown events
- Next by Date: Re: Load image from DB into PictureBox control
- Previous by thread: Re: Load image from DB into PictureBox control
- Next by thread: Re: Load image from DB into PictureBox control
- Index(es):
Relevant Pages
|