Tài liệu HotXLS

AddPicture phương thức

Chèn một hình ảnh vào bảng tính tại tọa độ ô đã chỉ định hoặc dưới dạng hình ảnh trôi nổi tự do

Cú pháp

function AddPicture(FileName: WideString): TXLSPicture; overload; function AddPicture(FileName: WideString; ARow, ACol: Integer): TXLSPicture; overload; function AddPicture(Bitmap: Graphics.TBitmap; Transparent: Boolean = False): TXLSPicture; overload; function AddPicture(Bitmap: Graphics.TBitmap; ARow, ACol: Integer; Transparent: Boolean = False): TXLSPicture; overload;

Ví dụ

Ví dụ này thêm một hình ảnh vào bảng tính đầu tiên ở hàng 5, cột 2

Workbook.Sheets[1].Shapes.AddPicture('c:\images\logo.png', 5, 2);