TXLSXImages ist die Arbeitsblatt-Bildsammlung, zugänglich über TXLSXWorksheet.Images , und jedes TXLSXImage trägt Bildbytes, Format, Ankergeometrie, Beschnitt, Bildkorrekturen, Füllmodus, Rotation und edit-sicheres importiertes DrawingML
Deklarationen
type
TXLSXImageFillMode = (xlsxImageFillStretch, xlsxImageFillTile);
TXLSXImage = class
procedure Assign(Source: TXLSXImage);
procedure Scale(APercent: Double; AKeepAspect: Boolean = True);
procedure ClearPreservedXml;
property Row, Col: Integer;
property WidthEMU, HeightEMU: Integer;
property WidthInch, HeightInch: Double;
property WidthCM, HeightCM: Double;
property WidthPt, HeightPt: Double;
property Format: TXLSXImageFormat;
property Data: AnsiString;
property AnchorType: TXLSXAnchorEditAs;
property CropLeft, CropTop, CropRight, CropBottom: Double;
property Transparency, Brightness, Contrast: Double;
property Rotation: Double;
property AltText: WideString;
property AltTextTitle: WideString;
property FillMode: TXLSXImageFillMode;
property HasPreservedXml: Boolean;
end;
TXLSXImages = class
function Add: TXLSXImage; overload;
function Add(Source: TXLSXImage): Integer; overload;
function FindAt(ARow, ACol: Integer): TXLSXImage;
function DeleteAt(ARow, ACol: Integer): Boolean;
function DeleteInRange(ARow1, ACol1, ARow2, ACol2: Integer): Integer;
property Items[Index: Integer]: TXLSXImage; default;
end;Wichtige Member
| Row and Col | 1-basierte Ankerzelle oben links |
| WidthEMU and HeightEMU | Native Zeichnungsabmessungen in English Metric Units |
| WidthInch, WidthCM and WidthPt | Praktische Geometrieansichten, die die zugrunde liegenden EMU-Maße aktualisieren |
| AnchorType | Wählt Verschieben und Größe mit Zellen, nur Verschieben oder absolutes Zeichnungsverhalten |
| CropLeft, CropTop, CropRight and CropBottom | Beschnittkanten des Quellbilds als Prozentwerte von 0 bis 100 |
| Transparency | Gleichmäßige Bildtransparenz von 0 bis 100 Prozent |
| Brightness and Contrast | Helligkeitsanpassungen von -100 bis 100 Prozent |
| Rotation | Formrotation im Uhrzeigersinn in Grad, begrenzt auf -360 bis 360 |
| AltText | Alternativtext für die Barrierefreiheit des Bilds, gelesen von Screenreadern und Hilfsmitteln |
| AltTextTitle | Barrierefreier Titel für das Bild |
| FillMode | Streckt das Bild einmal oder kachelt es über die Form |
| HasPreservedXml and ClearPreservedXml | Prüft oder verwirft edit-sicheres importiertes DrawingML eines Bilds |
| FindAt | Findet das Bild, das an einer 1-basierten Zellkoordinate verankert ist |
Beispiel
var Image: TXLSXImage;
begin
Image := Sheet.Images.Add;
Image.Row := 2;
Image.Col := 4;
Image.Data := PngBytes;
Image.Format := xlsxImagePng;
Image.WidthCM := 6;
Image.AnchorType := xaOneCell;
Image.CropLeft := 12.5;
Image.Transparency := 20;
Image.Brightness := 10;
Image.Contrast := -5;
Image.FillMode := xlsxImageFillStretch;
Image.Rotation := 15;
end;
Siehe auch