Page 1 of 1

PrintPreview BeginEdit EndEdit and Shading

PostPosted: August 26th, 2005, 12:47 pm
by Bronius
TPrintPreview is great. I am using version v4.62. Where is my mistake: I create a page using PrintPreview.Canvas.Brush.Color (see attached file Before_Edit.jpg). When I begin edit pages with BeginEdit()-EndEdit , the bottom of all pages looses shading (see attached file After_Edit.jpg). Thank You.

PostPosted: August 26th, 2005, 4:40 pm
by Kambiz
Hi,

Probably it's a Windows bug. Could you please post here some part of drawing code for both Creating and Editing of a page?

Sample code

PostPosted: August 27th, 2005, 10:19 am
by Bronius
Hello,
this is a Delphi project to show problem.

Sample project creates 3 pages with text on pages pA5, pA4 or pA3. Button "Edit" opens for edit current page. Nothing happens on pA5 pages. Shading disappears from position 280 mm from page top on pages pA4 and pA3.

If I save report to file, after Edit file size becomes smaller.

Thank You.

Bronius

PostPosted: August 27th, 2005, 10:26 pm
by Kambiz
Hi again,

The problem is in FillRect method of TCanvas.

By substituting Canvas.FillRect by the following code, everything works as expected.

Code: Select all
Canvas.Pen.Color := Canvas.Brush.Color;
Canvas.Pen.Style := psInsideFrame;
Canvas.Rectangle(Rect);


Cheers

Thanks

PostPosted: August 28th, 2005, 6:03 am
by Bronius
Thank You very much for quick solution of my problem.

Good luck.
------------------
Bronius