原創(chuàng)|其它|編輯:郝浩|2012-06-26 21:05:24.000|閱讀 753 次
概述:工作表加入圖片作為背景會(huì)讓工作表更具吸引力。你可以使用Aspose.Cells API來(lái)為表設(shè)置背景圖片。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
工作表加入圖片作為背景會(huì)讓工作表更具吸引力。你可以使用Aspose.Cells API來(lái)為表設(shè)置背景圖片。
在MS Excel 2003中要設(shè)置工作表的背景圖片,你可以嘗試:
1)從Format菜單中選擇sheet,然后選擇Background選項(xiàng)。
2)選擇圖片,將其設(shè)置為表的背景圖片
下面的代碼介紹了如何使用Aspose.Cells APIs執(zhí)行任務(wù):
[Java]
//Instantiate a new Workbook.
Workbook workbook = new Workbook();
//Get the first worksheet.
Worksheet sheet = workbook.getWorksheets().get(0);
//Get the image file.
File file = new File("f:\\test\\school.jpg");
//Get the picture into the streams.
byte[] imageData = new byte[(int)file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(imageData);
//Set the background image for the sheet.
sheet.setBackground(imageData);
//Save the excel file
workbook.save("f:\\test\\BackImageSheet.xls");
查看Aspose.Cells FAQ://fc6vip.cn/zh-CN/EVQuestions
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)