PDFium Delphi Component Docs

ObjectBitmap Propiedad

Componente: TPdf  ·  Unidad: PDFium
Propiedad indexada — devuelve un objeto de página imagen como un TBitmap de VCL renderizable (decodificado con pérdidas desde JPX/CCITT/etc.)

Sintaxis

property ObjectBitmap[Index: Integer]: TBitmap;// solo lectura

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 objetos de página que no son imagen

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 propietario de la instancia de TBitmap devuelta y debe llamar a Free al terminar con ella

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;

Véase también

BitmapCount, Image, ImageCount