Creates a picture from an existing file or TBitmap object. Returns a TXLSPicture object that represents the new picture.
Syntax
function AddPicture(FileName: WideString): TXLSPicture;
function AddPicture(Bitmap: TBitmap; Transparent: boolean = flase): TXLSPicture;
function AddPicture(Bitmap: TBitmap; TransparentPoint: TPoint): TXLSPicture;
| FileName |
Required WideString. The file from which the picture is to be created. |
| Bitmap |
Required TBitmap. TBitmap object from which the picture is to be created. |
| Transparent |
Optional Boolean. True to use color of pointer[0, 0] as transparent color; False - Transparent color is undefined. Default value is False |
| TransparentPoint |
Optional TPoint. Specifies the pointer with transparent color. |
Remarks
HotXLS supports the following image types: BMP, JPEG, PNG, EMF, WMF. Pictures supported only for MS Excel 97 and later file format
Example
This example creates new picture on sheet one.
With Workbook.Sheets[1] do begin
Cells[2, 2].Select; //the upper-left corner of the picture
Shapes.AddPicture('image.jpg');
end;
This example creates new picture using TBitmap object.
This example creates new picture and specifies white color as transparent.