trichview.com

trichview.support




Re: Error LeftMarginMM


Return to index


Author

Message

Anthony MOYER

Posted: 04/18/2002 12:13:09


I have seen your code and I don't understand this lines :


if (phW>phoX+PageWidth)

    phW = phoX+PageWidth;


I think this condition is always true and create a false result when you

calculate :

   TmpRM = MulDiv(RVPrint1->RightMarginMM,  5*lpx, 127)-

(phW-(phoX+PageWidth));

because the right margin offset calculate is 0.


i.e :

In my case, phw = 4960, phox = 100 and PageWidth = 4760.


The "if" is true and phw is affected to 4860.

The right margin offset is calcultate to 0 (4860-(100+4760)) and not 100

(4960-(100+4760)).


So : Right margin = RightMarginMM + Right margin offset.


I suppose the problem as same for Bottom margin Offset.



"Sergey Tkachenko" <[email protected]> a �crit dans le message de news:

[email protected]...

> Hm, are you sure about it?

> I calculate values of margins in pixels taking into account physical

> offsets.

> (preview does not show physical offsets at all - it shows margins minus

> physical offsets)

>

> Below is the code for calculating margings in pixels (TmpLM - left margin,

> TmpTM - right one, and so on)

>

>   lpy := GetDeviceCaps(PHDC, LOGPIXELSY);

>   lpx := GetDeviceCaps(PHDC, LOGPIXELSX);

>

>   phoX := GetDeviceCaps(PHDC, PHYSICALOFFSETX);

>   phoY := GetDeviceCaps(PHDC, PHYSICALOFFSETY);

>   phW  := GetDeviceCaps(PHDC, PHYSICALWIDTH);

>   phH  := GetDeviceCaps(PHDC, PHYSICALHEIGHT);

>

>   if phW>phoX+GetPageWidth then

>     phW := phoX+GetPageWidth;

>   if phH>phoY+GetPageHeight then

>     phH := phoY+GetPageHeight;

>

>     TmpLM := MulDiv(FLeftMarginMM,   5*lpx, 127)- phoX;

>     TmpTM := MulDiv(FTopMarginMM,    5*lpy, 127)- phoY;

>     TmpRM := MulDiv(FRightMarginMM,  5*lpx, 127)-

(phW-(phoX+GetPageWidth));

>     TmpBM := MulDiv(FBottomMarginMM, 5*lpy, 127)-

> (phH-(phoY+GetPageHeight));

>

> GetPageWidth is GetDeviceCaps(PJDC, HorzRes),

> GetPageHeight is GetDeviceCaps(PJDC, VertRes),

>

>

> >

> > I use the RichView Package 1.6.2 (Demo)

> >

> > When I print a RTF with TRVPrint, or when I preview with

TRVPrintPreview,

> > properties LeftMarginMM, TopMarginMM and LeftMarginMM are respected.

> > But the right margin is not respected.

> >

> > The right margin is not equal to "RightMarginMM" but is equal to

> > "RightMarginMM + distance from the right edge of the physical page to

the

> > right edge of the printable area"

> >

> > Is it normal ?

> >

>

>





Powered by ABC Amber Outlook Express Converter