Thanks a lot for a good work!
I think I found a small bug in TPrintPreview.PaintGraphic() function in several latest releases:
- Code: Select all
function TPrintPreview.PaintGraphic(X, Y: Integer; Graphic: TGraphic): TPoint;
var
Rect: TRect;
begin
Rect.Left := X;
Rect.Top := Y;
Rect.BottomRight := ScreenToPreview(Graphic.Width, Graphic.Height); //problem is here - begin coordinates of a rect are not applied
Result := PaintGraphicEx(Rect, Graphic, False, False, False).BottomRight;
end;
so, the fix could be e.g. the following:
- Code: Select all
function TPrintPreview.PaintGraphic(X, Y: Integer; Graphic: TGraphic): TPoint;
var
Rect: TRect;
pt: TPoint;
begin
Rect.Left := 0;
Rect.Top := 0;
Rect.BottomRight := ScreenToPreview(Graphic.Width, Graphic.Height);
OffsetRect(Rect, X, Y);
Result := PaintGraphicEx(Rect, Graphic, False, False, False).BottomRight;
end;
Mvg,
Ilya.