ImageEn, unit iexPdfiumCore |
|
TPdfObject.SetImage
Declaration
function SetImage(Bitmap: TIEBitmap): Boolean; overload;
function SetImage(Bitmap: TBitmap): Boolean; overload;
Description
Replaces the bitmap of an image object in the current page (when
ObjectType is ptImage).
Note:
◼Use
GetImage to get the image of an object
◼You must call ImageEnView1.PdfViewer.ReloadPage() after changing page images
// Replace all the images in the page
bmp := TIEBitmap.Create();
try
bmp.LoadFromFile( 'D:\MyLogo.jpg' );
for i := 0 to ImageEnView1.PdfViewer.Objects.Count - 1 do
if ImageEnView1.PdfViewer.Objects[i].ObjectType = ptImage then
begin
if ImageEnView1.PdfViewer.Objects[i].SetImage( bmp ) = False then
BREAK;
end;
finally
bmp.Free;
ImageEnView1.PdfViewer.ReloadPage();
end;
See Also
◼GetImage◼GetImageRaw◼AddImage