Type xlsxImage = Class
	///缺省构造函数
	Function Create(sheet,excel); overload;
	Begin
		excel_ := excel;
		sheetName_ := sheet;
		[rid_, imageFileName_, sheetFileName_, xmlRelsFile_] := excel_.WorkBook().GetRelationshipRid(sheet, '../media/image');
	End;
	
	class Function NewObject(sheet, excel);
	Begin
		excel_ := excel;
		o := excel_.WorkBook().GetSheetObj(sheet);//sheet存在
		if not ifObj(o) then return 0;
		return new xlsxImage(sheet, excel);
	End;

	Function SetSheetBackground(pictrue);
	Begin
		//if not ifBinary(picture.Image) or length(picture.Image) = 0 then
		//	raise "Invalid Image Data.";
		if imageFileName_ = '' then
		Begin
			rid_++;
			imageId := excel_.WorkBook().GetFilesCount('xl/media/') + 1;
			imageName := "../media/image" + inttostr(imageId);
			type := 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image';
			excel_.WorkBook().AddRelationshipRid(xmlRelsFile_, imageName, type, 'rId' + inttostr(rid_));
		End
		sheet_xml := excel_.WorkBook().GetSheetXmlfile(sheetName_);
		node := sheet_xml.FirstChildElement('worksheet');
		picture_node := node.FirstChildElement('picture');
		if ifObj(picture_node) then
		Begin
			node.DeleteChild(picture_node);
		End
		node := node.InsertEndChild('element', 'picture');
		node.SetAttribute('r:id', 'rId' + inttostr(rId_));
	End
	
private	
	sheetName_:string; //sheet名称
	sheetFileName_; //xl/worksheets/sheetN.xml
	excel_;//TSExcelFile对象
	xmlRelsFile_;
	imageFileName_;
	rid_;
End;
