Home > Archive > SQL Anywhere ultralite > April 2005 > Images from the DB in .NET









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Images from the DB in .NET
Matt H

2005-04-05, 8:03 pm

Hi experts,

Just wondering if anyone could point in the right direction here.... I have
written an App in c# using the Ultralite DB v9.02. I have a column which
stores an image as a long binary. Basically I am having trouble displaying
this in my app, basically I don't know how to convert this column into an
image.

Which control should I use ?
Must I convert the data in the Column to something else before I can display
it ?
Do I need to write the long binary data as bytes to a file, then just
display the file ?

Thanks, just if anyone has done this I would be grateful for any pointers.

Regards,

Matt


Philippe Bertrand

2005-04-06, 8:02 pm

I have not done this personally but I would put the image in a memory stream
and use Image.FromStream( stream ). Note that Image.FromStream() is not
listed in the Image class Members page of MSDN but does appear in the index.

It does not appear available under Compact Framework. You may want to post
in microsoft.public.dotnet.framework.compactframework to ask for an
alternative to Image.FromStream() if you need it there.

Hope that helps,

--
- Philippe Bertrand
iAnywhere Solutions, Inc.

Please include in your subject line what UltraLite API are you using
(I.E. UltraLite.NET, Native UltraLite for Java, Embedded SQL, C++,
(pure) Static Java UltraLite, etc.). Please include version and BUILD
numbers in your post.


"Matt H" < matth_abroad@hotmail
.com> wrote in message
news:4253215f$1@foru
ms-1-dub...
> Hi experts,
>
> Just wondering if anyone could point in the right direction here.... I
> have
> written an App in c# using the Ultralite DB v9.02. I have a column which
> stores an image as a long binary. Basically I am having trouble displaying
> this in my app, basically I don't know how to convert this column into an
> image.
>
> Which control should I use ?
> Must I convert the data in the Column to something else before I can
> display
> it ?
> Do I need to write the long binary data as bytes to a file, then just
> display the file ?
>
> Thanks, just if anyone has done this I would be grateful for any pointers.
>
> Regards,
>
> Matt
>
>



Matt H

2005-04-10, 8:23 pm

Thanks Philippe,

I cracked it with the following code...

PictureBox pb_image
MemoryStream ms = new MemoryStream( _rs.GetBytes(3) );

Bitmap b = new Bitmap(ms);

pb_image.Image = b;

Cheers,

Matt

"Philippe Bertrand" <my.name@ianywhere.com> wrote in message
news:4253ebc5$1@foru
ms-1-dub...
> I have not done this personally but I would put the image in a memory

stream
> and use Image.FromStream( stream ). Note that Image.FromStream() is not
> listed in the Image class Members page of MSDN but does appear in the

index.
>
> It does not appear available under Compact Framework. You may want to

post
> in microsoft.public.dotnet.framework.compactframework to ask for an
> alternative to Image.FromStream() if you need it there.
>
> Hope that helps,
>
> --
> - Philippe Bertrand
> iAnywhere Solutions, Inc.
>
> Please include in your subject line what UltraLite API are you using
> (I.E. UltraLite.NET, Native UltraLite for Java, Embedded SQL, C++,
> (pure) Static Java UltraLite, etc.). Please include version and BUILD
> numbers in your post.
>
>
> "Matt H" < matth_abroad@hotmail
.com> wrote in message
> news:4253215f$1@foru
ms-1-dub...
which[color=darkred]

displaying[color=dar
kred]
an[color=darkred]
pointers.[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com