Page 1 of 1

Using _Stream in Delphi

Posted: Wed Mar 07, 2012 7:05 pm
by BennyCUAG
Hello,
we have problems using "stream methods" like GdPictureImaging.SaveAsStream
In Delphi the signature looks like this:

Code: Select all

 function SaveAsStream(ImageID: Integer; const Stream: _Stream; ImageFormat: DocumentFormat;  EncoderParameter: Integer): GdPictureStatus; safecall;
_Stream is defined in mscorlib, but CoStream.Create creates an error (class not registered).
Does anybody know how to use or create a "_Stream" object in Delphi?

For images (GdPictureImaging) there is a SaveAsString method instead, why there is no SaveAsSting in GdPicturePDF (and LoadFromString)?

Thanks!

Re: Using _Stream in Delphi

Posted: Wed Mar 07, 2012 7:51 pm
by Loïc
Hello,

You can not use method having managed Stream object as parameter from Delphi. You need an IStream parameter.

In the next release we will add a SaveAsIStream method that you will be able to call by using a TStreamAdapter wrapper.

I will post a snippet as soon the solution will be implemented.

Kind regards,

Loïc

Re: Using _Stream in Delphi

Posted: Tue Jul 03, 2012 11:30 am
by BennyCUAG
Hello,
is there an new SaveAsIStream Method in Version 9?

Re: Using _Stream in Delphi

Posted: Tue Jul 03, 2012 7:53 pm
by Loïc
Yes!

Re: Using _Stream in Delphi

Posted: Tue Feb 05, 2013 5:38 pm
by BennyCUAG
Unfortunately there is no chance to get a (OCR) PDF (from a picture) as a Stream, isn´t it?
The GdPictureImaging.SaveAsPDF Methods have only _Stream parameters.. :|

Re: Using _Stream in Delphi

Posted: Wed Feb 06, 2013 4:34 pm
by Loïc
Hello,

the next release will include an overload of this method that takes an IStream object as parameter.

kind regards,

Loïc