PDFium Delphi Component Docs

ObjectBitmap Proprietà

Componente: TPdf  ·  Unità: PDFium
Proprietà indicizzata: restituisce un oggetto pagina immagine come TBitmap VCL renderizzabile, decodificato con perdita da JPX/CCITT e simili

Sintassi

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

Descrizione

Proprietà indicizzata in sola lettura che restituisce l'oggetto di pagina a Index come una TBitmap VCL/LCL appena allocata quando ObjectType[Index] = otImage, oppure nil per gli oggetti di pagina non immagine

Richiede Active a True. Gli indici validi sono 0 .. ObjectCount - 1 (per l'indicizzazione delle sole immagini in 0 .. BitmapCount - 1, usare invece Bitmap[Index])

Il chiamante possiede l'istanza di TBitmap restituita e deve chiamare Free quando ha finito

Parametri

IndexIndice degli oggetti di pagina a base zero nell'intervallo 0 .. ObjectCount - 1

Osservazioni

Esempio

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;

Vedi anche

BitmapCount, Image, ImageCount