Save a Chart EMF to a MemoryStream?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
FAB Soft
Newbie
Newbie
Posts: 1
Joined: Thu May 02, 2002 4:00 am
Contact:

Save a Chart EMF to a MemoryStream?

Post by FAB Soft » Thu Jan 13, 2005 10:47 pm

We are using TeeCharts 5.03 for Delphi7. Is there any way to save a Chart as an EMF to a MemoryStream? In the same vein as SaveToMetafileEnh(Filename), it would be nice if it could be saved to a MemoryStream instead. The stream can then be used elsewhere instead of having to create a disk file and then read it immediately in to a stream, which seems a little unneccessary.

Thanks

Nic

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Fri Jan 14, 2005 7:51 am

Hi, Nic.

Yes, sure, it ca be done. Example

Code: Select all

var tmpMeta: TMetafile;
begin
  tmpMeta := Chart1.TeeCreateMetafile(false,Chart1.ClientRect);
  try
    tmpMeta.SaveToStream(your_stream_comes_here);
  finally
    tmpMeta.Free;
  end;
end;
Marjan Slatinek,
http://www.steema.com

Post Reply