Page 1 of 1

Save a Chart EMF to a MemoryStream?

Posted: Thu Jan 13, 2005 10:47 pm
by 4211361
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

Posted: Fri Jan 14, 2005 7:51 am
by Marjan
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;