PDFium Delphi Component Docs

ObjectBitmap Propiedad

Componente: TPdf  ·  Unidad: PDFium
Propiedad indexada que devuelve un objeto de página de imagen como un TBitmap de VCL renderizable, decodificado con pérdida desde JPX, CCITT, etc

Sintaxis

property ObjectBitmap[Index: Integer]: TBitmap; // read only

Descripción

Propiedad indexada de solo lectura que devuelve el objeto de página en Index como un TBitmap de VCL/LCL recién asignado cuando ObjectType[Index] = otImage, o nil para los objetos de página que no son imágenes

Requiere que Active sea True. Los índices válidos son 0 .. ObjectCount - 1 (para indexar solo imágenes en 0 .. BitmapCount - 1, use Bitmap[Index])

Quien llama es dueño de la instancia de TBitmap devuelta y debe llamar a Free cuando termine de usarla

Parámetros

IndexÍndice de objeto de página basado en cero en el rango 0 .. ObjectCount - 1

Observaciones

Ejemplo

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;

Ver también

BitmapCount, Image, ImageCount