PowerPDF: implements proportional property for images

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2100 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
jesusr
2011-10-28 21:14:12 +00:00
parent 9bbc3015a2
commit 65f091f5d3
2 changed files with 60 additions and 6 deletions

View File

@ -47,7 +47,7 @@ procedure TPRJpegImage.Print(ACanvas: TPRCanvas; ARect: TRect);
var
FDoc: TPdfDoc;
FXObjectName: string;
i: integer;
i,AWidth,AHeight: integer;
begin
if not Printable then Exit;
@ -73,8 +73,13 @@ begin
FDoc.AddXObject(FXObjectName, CreatePdfImage(FPicture.Graphic, 'Pdf-Jpeg'));
end;
with ARect, ACanvas.PdfCanvas do
if FStretch then
DrawXObject(Left, Self.Page.Height - Bottom, Width, Height, FXObjectName)
if FStretch then begin
AWidth := Width;
AHeight := Height;
if Proportional then
CalcProportionalBounds(AWidth, AHeight);
DrawXObject(Left, Self.Page.Height - Top - AHeight, AWidth, AHeight, FXObjectName)
end
else
DrawXObjectEx(Left, Self.Page.Height - Top - FPicture.Height,
FPicture.Width, FPicture.Height,