Bmp: TBitmap;
ObjectBitmap - TPdf - PDFium Delphi Component
PDFium Delphi Component Docs

ObjectBitmap 속성

컴포넌트: TPdf  ·  유닛: PDFium
Indexed property — 하나의 image page object를 렌더 가능한 VCL TBitmap으로 반환합니다 (JPX/CCITT/etc.에서 손실 디코딩)

구문

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

설명

ObjectType[Index] = otImage이면 Index 위치의 페이지 객체를 새로 할당한 VCL/LCL TBitmap으로 반환하고, 이미지가 아닌 페이지 객체에는 nil을 반환하는 indexed 읽기 전용 프로퍼티입니다

Active가 True여야 합니다. 유효한 인덱스는 0 .. ObjectCount - 1입니다(0 .. BitmapCount - 1 범위로 이미지만 인덱싱하려면 대신 Bitmap[Index]를 사용하세요)

반환된 TBitmap 인스턴스는 호출자가 소유하므로 다 쓴 뒤 Free를 호출해야 합니다

매개변수

Index0 .. ObjectCount - 1 범위의 0 기반 페이지 객체 인덱스입니다

참고 사항

예제

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
    // inspect Pdf1.ObjectBitmap[I]
      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;

관련 항목

BitmapCount, Image, ImageCount