trichview.com

trichview.support




Re: Question on TRvHelper example and preview


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/31/2003 15:50:20


Hello.


I attached a modified version. It makes preview with TRVPrintPreview

component (making preview in TImage is a bit more complicated).


It does the following:

- creates an empty document in rvh_fake.RichView (it's not important that

this document is in reporthelper, it can be in any hidden RichView)

- assigns this document as a source for printing to TRVPrint1. After calling

FormatPages, you can see an empty page in RVPrintPreview.

- actual code for drawing document in print preview is done in

RVPrint1.OnPagePrepaint event. This event provides a Canvas with required

resolution.

The only small problem: you cannot use RVReportHelper.DrawPageAt, because it

sets offset of left-top corner of the document in pixels of device (screen,

in this case), using SetViewportOrgEx. But we need to set it in logical

coordinates. What's why this code uses SetWindowOrgEx +

RVReportHelper.DrawPage (coordinates of left-top corner are passed to

SetWindowOrgEx with minus sign).


Btw, this code had a small bug (that also presents in the original demo) -

it forgets to clear document before loading, so it appends new RTF file to

the previously loaded instead of replacing it.



>

> Printing text in two columns using trvhelper is very useful, but how to

> make preview CORRECTLY for it? I've attached modified ReportHelper with

> preview made on TImage, but result isn't too bright. Any suggestion

> about better implementation of preview for it?

>



begin 666 preview.zip

M4$L#!!0``@`(`.*$?RZS\>+',0@``.0A```)````56YI=#$N<&%S[5E9;QLY

M$GX?8/X#%]A9M^*6)E(R+Q:R6/G0Q(#C"++BP6(F&-#=E,1-BVR0U(5@_OM6

MD<V^I+8EQ\!@#S_8/.IB5;&^8OMK^V5_OO^.D$NVD&<D55P8+F8DEM%RP831

M9*EQ/AG?CUDJE7G/DI2I#K),YER3&/A((FFLR?A^2*8\880+HE;SSIA'\WO.

MUH2*V$G6A!O+"ML]PE$XBXF1;I?,&8V9.B-!FZ1TQHB0I-T">N08Q"LJ#*QJ

M(J?$H.H%,W,9G^$N,$BM^0-/N-FBP 7]PDBTU$8N2"07:<(VF7AMS9E*:6 <

MDIA/ITS!26%)H2A26D(K='^O`HXRT4-@I= &9%(5DX1NY=* V-R1FJV8HDGA

M4*<#7%2HH8I1.): 8S&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]$DF5/#,G%-T@8E:XVPF,/A.]ER+EM7%<1D'$9;S-&AITYKT8PG,DF4/)

M''Y,YO"/>&OL\+^"_P%02P$"% `4``(`" #BA'\NL_'BQS$(``#D(0``"0``

M```````!`" `MH$`````56YI=#$N<&%S4$L!`A0`% `"``@`<*IV+4O+S'J(

M````P ```! ``````````0`@`+:!6 @``%)E<&]R=$AE;'!E<BYD<')02P$"

M% `4``(`" "'6GPN'_&5UW$!``!L`P``$ ```````````" `MH$."0``4F5P

M;W)T2&5L<&5R+G)E<U!+`0(4`!0``@`(`,*"?R[-@&_-9@4``',P```)````

M``````$`( "V@:T*``!5;FET,2YD9FU02P4&``````0`! #J````.A `````

`

end





Powered by ABC Amber Outlook Express Converter