Hi,
printing annotations using the chartpreviewer has still 2 effects.
1. Printing with smoothing --> position of annotations are ok
2. Printing without smoothing --> annotations are print with a negative offset
I've tested this with the "New feature demo".
Can you please help me.
Best Regards
Dirk Zirwes
Problem with printing annotations
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dirk,
The best solution is to use the temporary metafile + StretchDraw method to print charts with custom objects (text, annotation, etc..).
The Rect parameter in StretchDraw defines the drawing rectangle, in this case printer.canvas drawing rectangle.
The best solution is to use the temporary metafile + StretchDraw method to print charts with custom objects (text, annotation, etc..).
The Rect parameter in StretchDraw defines the drawing rectangle, in this case printer.canvas drawing rectangle.
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, TeEngine, TeeTools, Series, ExtCtrls, TeeProcs,
Chart,
TeeComma;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TLineSeries;
ChartTool1: TAnnotationTool;
TeeCommander1: TTeeCommander;
procedure CustomClickEvent(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
Uses Printers;
{$R *.dfm}
procedure TForm1.CustomClickEvent(Sender: TObject);
var tmpMeta: TMetafile;
begin
Chart1.BevelOuter := bvNone;
Chart1.Frame.Visible := False;
tmpMeta := Chart1.TeeCreateMetafile(True,Chart1.ClientRect);
try
Printer.Orientation := poLandscape;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(10,10,Printer.PageWidth -
10, Printer.PageHeight - 10),tmpMeta);
finally
Printer.EndDoc;
end;
finally
tmpMeta.Free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
TeeCommander1.ButtonPrint.OnClick := CustomClickEvent;
end;
end.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |