How to draw the chart to a metafile.


This example uses the PaintTo method to draw the chart to a metafile canvas.

var
  emf: TMetaFile;
  emfcvs: TMetafileCanvas;
begin
  emf := TMetafile.Create();
  try
    emf.Enhanced := true;
    emf.Width := RAC.ClientWidth;
    emf.Height := RAC.ClientHeight;
    emf.MMWidth := 0;
    emf.MMHeight := 0;
    emfcvs := TMetafileCanvas.Create(emf, 0);
    try
      RAC.PaintTo(emfcvs, RAC.ClientRect, RAC.FirstDisplayedIndex);
    finally
      emfcvs.Free;
    end;
    emf.SaveToFile('RAC.emf');
  finally
    emf.Free;
  end;
end;
What People Say

I did want to drop you a note and tell you what a wonderful component. It's a must have component if you are a serious Delphi developer.
Miguel Henley, Brazil
More …

No malware No spam
McAfee Site Report
Web of Trust