وثائق HotXLS

TXLSXHeaderFooterImage and TXLSXHeaderFooterImages classes

Unit: lxHandleX
TXLSXHeaderFooterImages is the typed image collection exposed by TXLSXWorksheet.HeaderFooterImages
يدعم كل نوع صفحة صوراً يسرى ووسطى ويمنى في الترويسة والتذييل معاً، أي ثمانية عشر موضع صورة مستقلاً

Declarations

type
  TXLSXHeaderFooterPageKind = (
    xlsxHFOddPage, xlsxHFEvenPage, xlsxHFFirstPage);

  TXLSXHeaderFooterPicturePosition = (
    xlsxHFLeftHeader, xlsxHFCenterHeader, xlsxHFRightHeader,
    xlsxHFLeftFooter, xlsxHFCenterFooter, xlsxHFRightFooter);

  TXLSXHeaderFooterImage = class
    property PageKind: TXLSXHeaderFooterPageKind;
    property Position: TXLSXHeaderFooterPicturePosition;
    property WidthPt, HeightPt: Double;
    property MarginLeftPt, MarginTopPt: Double;
    property Format: TXLSXImageFormat;
    property Data: AnsiString;
    property Title: WideString;
  end;

  TXLSXHeaderFooterImages = class
    function Add(APageKind: TXLSXHeaderFooterPageKind;
      APosition: TXLSXHeaderFooterPicturePosition): TXLSXHeaderFooterImage; overload;
    function AddFromFile(APageKind: TXLSXHeaderFooterPageKind;
      APosition: TXLSXHeaderFooterPicturePosition;
      const AFileName: WideString): TXLSXHeaderFooterImage;
    function Find(APageKind: TXLSXHeaderFooterPageKind;
      APosition: TXLSXHeaderFooterPicturePosition): TXLSXHeaderFooterImage;
    function Delete(APageKind: TXLSXHeaderFooterPageKind;
      APosition: TXLSXHeaderFooterPicturePosition): Boolean; overload;
    procedure Clear;
    property Count: Integer;
    property Items[Index: Integer]: TXLSXHeaderFooterImage; default;
  end;

Behaviour

Example

var
  Image: TXLSXHeaderFooterImage;
begin
  Image := Sheet.HeaderFooterImages.AddFromFile(
    xlsxHFOddPage, xlsxHFLeftHeader, 'logo.png');
  Image.WidthPt := 86;
  Image.HeightPt := 42;

  Sheet.HeaderFooterImages.AddFromFile(
    xlsxHFEvenPage, xlsxHFCenterFooter, 'confidential.png');
end;

See also