trichview.com

trichview.support




Re: how can remove the zoom event of TRVPrintPreview?


Return to index


Author

Message

chenfx

Posted: 02/28/2003 11:42:27


----- Original Message -----

From: "Sergey Tkachenko" <[email protected]>

Newsgroups: trichview.support

Sent: Saturday, February 15, 2003 5:02 AM

Subject: Re: how can remove the zoom event of TRVPrintPreview?



> If you want to draw lines at the same positions on preview and on paper,

you

> need to use OnPagePrepaint (or OnPagePostpaint).

> These events have Canvas of printer resolution (both when printing and

when

> previewing).

>

> So the main problem is defining coordinates of lines with the mouse. You

> need to recalculate coordinates inside the clicked component to the

> coordinates on the paper.

> It is not a trivial task with TRVPrintPreview component.

> I suggest you to use your own component (TPaintBox) instead of

> TRVPrintPreview.

>

> Create a PaintBox. Set its size proportional to size of paper (use

> properties Preview100PercentWidth and Preview100PercentHeight of

TRVPrint).

> Use RVPrint.DrawPreview(..., PaintBox.Canvas, ...) to draw page image (on

> PaintBox.OnPaint).

> When user click at PaintBox at position (X,Y), draw line on PaintBox at

> (X,Y), but in OnPagePrepaint at

> (PageRect.Left+  X *(PageRect.Right-PageRect.Left) div PaintBox.Width,

> (PageRect.Top+  Y *(PageRect.Bottom-PageRect.Top) div PaintBox.Height)

>


In 1.8, u plan implementing WYSIWYG displaying (independent from printer and

screen resolutions)

so , can u support to draw lines by mouse on TRVReportHelper?










Powered by ABC Amber Outlook Express Converter