Hi Kambiz,
I noticed that changing the
units properties of the component in design time, properties
PAPERHEIGTH AND PAPERWIDTH are not
updated with the new units,
I have to change the PaperType
and then reset the desired Papertype
to refresh the PAPERHEIGTH AND PAPERWIDTH
This procedure in Vers. 5.10
work well, but I have to make some strange settings
Procedure MyDraw;
Procedure MyRect(L,T,R,B : Integer);
Begin
With PrintPreview Do
Begin
Canvas.Pen.Width := 1;
Canvas.Pen.Style :=psSolid;
L:=ConvertX(L*10, mmLoMetric, Units);
T:=ConvertY(T*10, mmLoMetric, Units);
R:=ConvertX(R*10, mmLoMetric, Units);
B:=ConvertY(B*10, mmLoMetric, Units);
// everything is correct, notice R+1,B+1 all lines of then rectangles, have
// same thickness
PrintPreview.Canvas.Rectangle(L,T,R+1,B+1);
// not correct, without R+1,B+1 the internal lines of rectangles
// have a greater thickness
PrintPreview.Canvas.Rectangle(L,T,R,B); //
End;
End;
Begin // MyDraw
With PrintPreview do
Begin
UsePrinterOptions:=False;
units:=mmpixel;
PaperType=pA3;
PaperType=pA4; // refresh the PAPERHEIGTH AND PAPERWIDTH in mmpixel pA4
// without these two settings(pA3,pA4) the preview does not display the data well in my pA4
Begindoc;
MyRect(20,20,30,30); MyRect(30,20,40,30);
MyRect(20,30,30,40); MyRect(30,30,40,40);
Enddoc;
End;
End; // MyDraw;
If I specific units other than mmpixel,
you always see rectangles with sides in common
more marked
Thanks again for your interest