Page 1 of 1

LoadFromStream/SaveToStream (Delphi)

Posted: Sun Nov 02, 2003 1:36 pm
by Adem
I am trying to create a class based on TGraphic but I need a little more info.

Is there a way to emulate LoadFromStream and SaveToStream methods in the SDK?

gflLoadBitmapFromHandle() looks as if it can handle that sort of thing, but I am not sure --nor do I know what each parameter means in real life. Especially the 'handle: GFL_HANDLE'.

Cheers,
Adem

Re: LoadFromStream/SaveToStream

Posted: Thu Nov 06, 2003 11:01 pm
by Matthias
I went around this by simply saving the stream to a temp file and then have libgfl load/save the file.

Matthias

Re: TGraphic

Posted: Thu Nov 06, 2003 11:02 pm
by Matthias
Do you think about releasing your TGraphic descendant? I would be interested in replacing my own with a better one :)

Matthias

Posted: Fri Nov 07, 2003 1:10 am
by Adem
Second question first: Yes, of course I will/would publish it. I dont see any reason why I should keep it private.

Now, the first: I hate using disk for that sort operation. It defeats the whole idea of being a fast lib --all we end up with is a cludge.

Once I get some answer to this loadstream/savestream issue, my next target will be using TSharedImage since TGraphic uses it quite cleverly to speed up Assign().

Cheers,
Adem

Re: LoadFromStream/SaveToStream [Delphi]

Posted: Wed Nov 12, 2003 2:40 pm
by xnview
Hello,
Adem wrote:Is there a way to emulate LoadFromStream and SaveToStream methods in the SDK?
gflLoadBitmapFromHandle() looks as if it can handle that sort of thing, but I am not sure --nor do I know what each parameter means in real life. Especially the 'handle: GFL_HANDLE'.
Yes, you must use gflLoadBitmapFromHandle. GFL_HANDLE is a pointer of your data. If you know C/C++, there is an example.
Regards. Pierre.

gflLoadBitmapFromHandle with Delphi..a few lines of code ple

Posted: Sun Feb 13, 2005 11:38 pm
by Philips10
Hi Pierre

Could you please give us Delphi-programmers a few lines of code that shows us how to use gflLoadBitmapFromHandle

I got

Code: Select all

 ms := tmmorystream.creat
 try
   ........
   image1.picture.bitmap.savetostream(ms);
   e := gflLoadBitmapFromHandle( ?? , gfl_bmp, lp, fInfo);
    .........
 finally
   ms.free;
 end;
If this is right so far, what to add for the two questionmarks ??

If not at all, please a few lines that shows the use of gflLoadBitmapFromHandle

Thanks and kind Regards

Jansen