Board index » delphi » bitmap.loadfromstream?

bitmap.loadfromstream?

Hi,

I have the following problem:

I have a full bitmap with header in a string or a byte-array. It has been
read
from a file before, but that's not important.
I want to use this information to fill a variabel of type tbitmap.
Since I don't have the file I can't do bitmap.loadfromfile.

I thought I could use bitmap.loadfromstream, but I don't know how
I can transform my string or byte-array into a stream, that can be read by
loadfromstream.

Any ideas?

Thanks in advance

Juergen

 

Re:bitmap.loadfromstream?


Hi
Why not create a MemoryStream and write your data into it, then
LoadFromStream?
Simon

Quote
"Juergen Schlinker" <juergenschlin...@gmx.de> wrote in message

news:b953qn$a4h$1@nets3.rz.RWTH-Aachen.DE...
Quote
> Hi,

> I have the following problem:

> I have a full bitmap with header in a string or a byte-array. It has been
> read
> from a file before, but that's not important.
> I want to use this information to fill a variabel of type tbitmap.
> Since I don't have the file I can't do bitmap.loadfromfile.

> I thought I could use bitmap.loadfromstream, but I don't know how
> I can transform my string or byte-array into a stream, that can be read by
> loadfromstream.

> Any ideas?

> Thanks in advance

> Juergen

Re:bitmap.loadfromstream?


Quote
> Why not create a MemoryStream and write your data into it, then
> LoadFromStream?

I guess that's what I'm trying to do, but I've never done that and didn't
know it would work with loadfromstream.

Can you give me a short example how to do this?

Juergen

Re:bitmap.loadfromstream?


Yepp,

that's it. I didn't manage to do so, but thank's to somebody else, who gave
me an example,
I worked it out by now.

Thanks anyway.

Juergen

Re:bitmap.loadfromstream?


Thanks,

that's exactly what I wanted to do and couldn't achieve. I managed to do it
now.

Juergen

Other Threads