เอกสาร HotXLS

AddPicture วิธีการ

แทรกรูปร่างรูปภาพลงในเวิร์กชีตตามพิกัดเซลล์ที่ระบุหรือเป็นรูปภาพลอยอิสระ

ไวยากรณ์

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;

ตัวอย่าง

ตัวอย่างนี้เพิ่มรูปภาพลงในเวิร์กชีตแรกที่แถว 5 คอลัมน์ 2

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