原創(chuàng)|其它|編輯:郝浩|2012-11-29 13:35:53.000|閱讀 1268 次
概述:可以使用Aspose.Cells為電子表格添加特殊的藝術(shù)字效果。例如,可以拉伸標(biāo)題,修飾文本,并使文本符合預(yù)設(shè)形狀,或者是為圖表添加水印效果。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
可以使用Aspose.Cells為電子表格添加特殊的藝術(shù)字效果。例如,可以拉伸標(biāo)題,修飾文本,并使文本符合預(yù)設(shè)形狀,或者是為圖表添加水印效果。
在下面的例子中將演示如何使用Aspose.Cells提供的簡單API在圖表的圖形區(qū)添加藝術(shù)字水印效果。
示例代碼:
Java
String filePath = "F:/Shak-Data-RW/Downloads/source.xls"; //Instantiate a new workbook. //Open the existing excel file. Workbook workbook = new Workbook(filePath); //Get the chart in the first worksheet. com.aspose.cells.Chart chart = workbook.getWorksheets().get(0).getCharts().get(0); //Add a WordArt watermark (shape) to the chart's plot area. com.aspose.cells.Shape wordart = chart.getShapes().addTextEffectInChart(MsoPresetTextEffect.TEXT_EFFECT_2, "CONFIDENTIAL", "Arial Black", 66, false, false, 1200, 500, 2000, 3000); //Get the shape's fill format. com.aspose.cells.MsoFillFormat wordArtFormat = wordart.getFillFormat(); //Set the transparency. wordArtFormat.setTransparency(0.9); //Get the line format and make it invisible. com.aspose.cells.MsoLineFormat lineFormat = wordart.getLineFormat(); lineFormat.setVisible(false); //Save the excel file. workbook.save(filePath + ".out.xls", SaveFormat.EXCEL_97_TO_2003); 如圖所示:
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)