property ObjectBitmap[Index: Integer]: TBitmap; // read only
Indexed read-only property returning the page object at Index as a freshly allocated VCL/LCL TBitmap when ObjectType[Index] = otImage, or nil for non-image page objects
Needs Active to be True. Valid indexes are 0 .. ObjectCount - 1 (for image-only indexing in 0 .. BitmapCount - 1, use Bitmap[Index] instead)
The caller owns the returned TBitmap and must Free it when finished
| Index | Zero-based index in the range 0 .. ObjectCount - 1 |
ObjectType[Index] = otImage (or check Assigned(Bmp)) before using the returned bitmap, and free it from a try .. finally blockRemoveObject or InsertObjectAtIndex) shift page-object indexes; 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;