🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.language.csharp
3 messages
3 total messages Started by Mick Fri, 26 May 2006 12:14
Converting byte[] to bitmap
#44
Author: Mick
Date: Fri, 26 May 2006 12:14
5 lines
1179 bytes
I am loading a jpeg byte[] from a database and i am trying to load this into 
a bitmap object wher i can resize it. I can do this by copying the byte[] to 
a file and using the standard bitmap load from file functions;

Is there a way I can do this without having to goto to the disk?
Re: Converting byte[] to bitmap
#45
Author: Marc Rohloff TeamB
Date: Fri, 26 May 2006 13:00
17 lines
1783 bytes
On Fri, 26 May 2006 13:14:38 +0100, Mick wrote:

> I am loading a jpeg byte[] from a database and i am trying to load this into 
> a bitmap object wher i can resize it. I can do this by copying the byte[] to 
> a file and using the standard bitmap load from file functions;
> 
> Is there a way I can do this without having to goto to the disk?

I assume you mean load it from a file using the constructor?

You should be able to use a MemoryStream which accepts a byte[] in its
constructor and then pass this Stream to the constructor of your
Bitmap.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: Converting byte[] to bitmap
#46
Author: Mick
Date: Fri, 26 May 2006 15:01
24 lines
1797 bytes
Thanks for that! Works a treat!


"Marc Rohloff [TeamB]" <"on request"> wrote in message 
news:1xxx3grz8ki2o$.dlg@dlg.marcrohloff.com...
> On Fri, 26 May 2006 13:14:38 +0100, Mick wrote:
>
>> I am loading a jpeg byte[] from a database and i am trying to load this 
>> into
>> a bitmap object wher i can resize it. I can do this by copying the byte[] 
>> to
>> a file and using the standard bitmap load from file functions;
>>
>> Is there a way I can do this without having to goto to the disk?
>
> I assume you mean load it from a file using the constructor?
>
> You should be able to use a MemoryStream which accepts a byte[] in its
> constructor and then pass this Stream to the constructor of your
> Bitmap.
>
> -- 
> Marc Rohloff [TeamB]
> marc rohloff -at- myrealbox -dot- com 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads