I encountered something strange when drawing an image multiple times using PaintGraphicEx. The image is a simple line. When I paint it about 40 times onto the PrintPreview, 4 of these lines aren't the same width as the others, see attachment.
I now use version 5.14 on Vista but an older system with version 4.77 on XP reacts the same.
So just drop a printpreview on a new form, create yourself a image with a horizontal line and use the code below. Hope you have the same result and have some idea how to fix this.
Thanks for any suggestions.
Regards,
Tom
- Code: Select all
procedure TForm1.PrintPreviewDblClick(Sender: TObject);
var YOffset : integer;
begin
YOffset := 10;
PrintPreview.BeginDoc;
while YOffset < 400 do
begin
with PrintPreview do
PaintGraphicEx(Rect(ConvertX(10, mmPixel, mmHiMetric),
ConvertY(YOffset, mmPixel, mmHiMetric),
ConvertX(500, mmPixel, mmHiMetric),
ConvertY(YOffset + 2, mmPixel, mmHiMetric)),
Image1.Picture.Graphic,
True, True, True);
Inc(YOffset, 10);
end;
PrintPreview.EndDoc;
end;