Unit: lxHandleX
TXLSXHeaderFooterImages is the typed image collection exposed by TXLSXWorksheet.HeaderFooterImages
Ogni tipo di pagina supporta immagini a sinistra, al centro e a destra sia nell'intestazione che nel piè di pagina, per un totale di diciotto slot immagine indipendenti
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
- Open e Save preservano i byte dell'immagine, il formato, il titolo, le dimensioni in punti, i margini in punti e il disegno VML posseduto dalla relationship
- I disegni con immagini di intestazione e piè di pagina restano indipendenti dai disegni dei commenti presenti sullo stesso foglio
Delete and Clear rimuovono il codice di campo dell'immagine corrispondente lasciando intatto il testo di intestazione e piè di pagina non correlato
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