原創|其它|編輯:郝浩|2012-11-29 13:35:53.000|閱讀 1268 次
概述:可以使用Aspose.Cells為電子表格添加特殊的藝術字效果。例如,可以拉伸標題,修飾文本,并使文本符合預設形狀,或者是為圖表添加水印效果。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
可以使用Aspose.Cells為電子表格添加特殊的藝術字效果。例如,可以拉伸標題,修飾文本,并使文本符合預設形狀,或者是為圖表添加水印效果。
在下面的例子中將演示如何使用Aspose.Cells提供的簡單API在圖表的圖形區添加藝術字水印效果。
示例代碼:
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); 如圖所示:
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網