ImageEn, unit iexPdfiumCore |
|
TPdfObjectList.AddImage
Declaration
function AddImage(X, Y, Width, Height: Single; Bitmap: TBitmap; MaintainAR: Boolean = True; Rotation: Double = 0): TPdfObject; overload;
function AddImage(X, Y, Width, Height: Single; Bitmap: TIEBitmap; MaintainAR: Boolean = True; Rotation: Double = 0): TPdfObject; overload;
function AddImage(X, Y, Width, Height: Single; const Filename: string; MaintainAR: Boolean = True; Rotation: Double = 0): TPdfObject; overload;
Description
Add an image object to the current page at the specified position (in terms of PDF points).
Note:
◼PDF pages are specified Bottom-Up, i.e. Y=0 refers to the bottom of the page/screen. Y=PageHeight refers to the top of the page/screen
◼Rotation occurs at x,y. So for rotation of 180 deg. for example, x,y will be the top-right of the image
var
bmp: TIEBitmap;
begin
if dlgOpenImage.Execute() then
begin
bmp := TIEBitmap.Create();
try
if bmp.LoadFromFile( dlgOpenImage.Filename ) = False then
EXIT;
ImageEnView1.PdfViewer.Objects.AddImage( 100, 800, 200, 200, bmp );
finally
bmp.Free();
end;
end;
end;
// Which is the same as...
begin
if dlgOpenImage.Execute() then
ImageEnView1.PdfViewer.Objects.AddImage( f100, 800Y, 200, 200, dlgOpenImage.Filename );
end;