Unit: lxHandleX
TXLSXHeaderFooterImages is the typed image collection exposed by TXLSXWorksheet.HeaderFooterImages
Każdy rodzaj strony obsługuje obrazy lewe, środkowe i prawe zarówno w nagłówku, jak i w stopce, co daje osiemnaście niezależnych slotów na obrazy
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
Add reuses the selected slot and inserts the required &G field into the matching header or footer section
- Even-page and first-page images automatically enable
DifferentOddEven and DifferentFirst
AddFromFile accepts PNG, JPEG, GIF, BMP, EMF, and WMF payloads
- Otwarcie i zapis zachowują bajty obrazu, format, tytuł, wymiary w punktach, marginesy w punktach oraz rysunek VML należący do relacji
- Rysunki obrazów nagłówka i stopki pozostają niezależne od rysunków komentarzy arkusza na tym samym arkuszu
Delete and Clear usuwają pasujący kod pola obrazu, pozostawiając nietkniętą niezwiązaną treść nagłówka i stopki
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