property ObjectBitmap[Index: Integer]: TBitmap; // read only
Indexed read-only property that returns the page object at Index as a newly allocated VCL/LCL TBitmap when ObjectType[Index] = otImage, or nil for non-image page objects
Requires Active to be True. Valid indices are 0 .. ObjectCount - 1 (for image-only indexing in 0 .. BitmapCount - 1, use Bitmap[Index] instead)
The caller owns the returned TBitmap instance and must call Free when finished with it
| Index | Zero-based page-object index in the range 0 .. ObjectCount - 1 |
ObjectType[Index] = otImage (or check Assigned(Bmp)) before using the returned bitmap, and free it in a try .. finally blockRemoveObject or InsertObjectAtIndex) change page-object indices; re-query ObjectCount after edits
var
I: Integer;
Bmp: TBitmap;
begin
if not Pdf1.Active then Exit;
for I := 0 to Pdf1.ObjectCount - 1 do
if Pdf1.ObjectType[I] = otImage then
begin
Bmp := Pdf1.ObjectBitmap[I];
try
if Assigned(Bmp) then
Memo1.Lines.Add(Format('Object %d: %dx%d', [I, Bmp.Width, Bmp.Height]));
finally
Bmp.Free;
end;
end;
end;