Re: Load image from DB into PictureBox control



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
>>
>>
>>


.



Relevant Pages

  • Re: Load image from DB into PictureBox control
    ... "Tim Wilson" wrote: ... > If the image is in a Byte array then you could create a MemoryStream using ... >> King Wilder ...
    (microsoft.public.dotnet.framework.windowsforms)
  • RE: Arrays, Got Me Confused
    ... Thanks for that Tim and Steve, ... Basically I'm trying to create a class that contains an array of MAC ... Python has two central datastructures ...
    (comp.lang.python)
  • Re: foreach and destroying variables for memory saving
    ... I read somewhere that foreach actually uses a copy of $ar ... instead of the array itself by reference. ... i take there is no garbage collection in php? ... Hi Tim, ...
    (php.general)
  • Re: C question!
    ... Yes Tim, you are right! ... But I am using an array, ... you have an opportunity to replace that with an iterative loop. ... First, when you repeat code, you ...
    (microsoft.public.vc.language)
  • Re: A7N8X-e RAID 0 Stripe Size advice??
    ... Tim wrote in alt.comp.periphs.mainboard.asus and: ... >> Just for kicks I'm about to put together a 2 disc RAID 0 array on my ... >> everything I need but would anyone in here care to recommend a stripe ... to re-install in the event of a catastrophe... ...
    (alt.comp.periphs.mainboard.asus)