[DUG] Print Preview
Sean Cross - CRM
sean.cross at crm.co.nz
Fri Nov 25 15:23:53 NZDT 2005
No it isn't. The contents may not be available depending on how the
printer works.
As Kyley says, the best bet is to redesign your drawing code to draw to
an arbitary canvas. Then a preview is the same as printing. You can
scale the fonts by setting Canvas.Font.PixelsPerInch.
Regards
Sean
-------------------------
Sean Cross
Systems Development Manager
CRM
PO Box 230
Napier
DDI: 06 834 0362
Mobile: 021 270 3466
Email: sean.cross at crm.co.nz
Offices located in Auckland, Napier, Wellington & Christchurch
> -----Original Message-----
> From: delphi-bounces at ns3.123.co.nz
> [mailto:delphi-bounces at ns3.123.co.nz] On Behalf Of John Bird
> Sent: Friday, 25 November 2005 2:57 p.m.
> To: 'NZ Borland Developers Group - Delphi List'
> Subject: [DUG] Print Preview
>
> Was experimenting with adding a print preview by copying from
> the Printer.canvas to a form.canvas and showing it
>
> PrintRect,PreviewRect:TRect;
> begin
>
> duPageWidth:=GetDeviceCaps(Printer.Canvas.Handle,PHYSICALWIDTH);
>
> duPageHeight:=GetDeviceCaps(Printer.Canvas.Handle,PHYSICALHEIGHT);
>
> //show this page with copyrect command
> PrintRect:=Rect(10,10,duPageWidth-20,duPageHeight-20);
>
> PreviewRect:=Rect(10,10,frmjkblPrint.Width-20,frmjkblPrint.Height-20);
>
> frmjkblPrint.Canvas.CopyRect(PreviewRect,Printer.Canvas,PrintRect);
> frmjkblPrint.show;
>
> But it doesn't work...
> Is it legit to copyrect from Printer.canvas?
>
>
> John
>
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
More information about the Delphi
mailing list