使用Aspose.Cells为工作表添加艺术字水印
2012-11-14 13:21
791 查看
可以使用Aspose.Cells为电子表格添加特殊的文字效果。例如,可以拉伸标题,修饰文本,并使文本符合预设形状,或者是为电子表格添加水印效果。
在下面的例子中将演示如何使用Aspose.Cells提供的简单API为工作表添加水印效果。
示例代码:
C#
[VB]
在下面的例子中将演示如何使用Aspose.Cells提供的简单API为工作表添加水印效果。
示例代码:
C#
//Instantiate a new Workbook Workbook workbook = new Workbook(); //Get the first default sheet Worksheet sheet = workbook.Worksheets[0]; //Add Watermark Aspose.Cells.Drawing.Shape wordart = sheet.Shapes.AddTextEffect(MsoPresetTextEffect.TextEffect1, "CONFIDENTIAL", "Arial Black", 50, false, true , 18, 8, 1, 1, 130, 800); //Get the fill format of the word art MsoFillFormat wordArtFormat = wordart.FillFormat; //Set the color wordArtFormat.ForeColor = System.Drawing.Color.Red; //Set the transparency wordArtFormat.Transparency = 0.9; //Make the line invisible MsoLineFormat lineFormat = wordart.LineFormat; lineFormat.IsVisible = false; //Save the file workbook.Save("e:\\test2\\Watermarkt_Test.xls");
[VB]
'Instantiate a new Workbook Dim workbook As New Workbook() 'Get the first default sheet Dim sheet As Worksheet = workbook.Worksheets(0) 'Add Watermark Dim wordart As Aspose.Cells.Drawing.Shape = sheet.Shapes.AddTextEffect(MsoPresetTextEffect.TextEffect1, "CONFIDENTIAL", "Arial Black", 50, False, True, 18, 8, 1, 1, 130, 800) 'Get the fill format of the word art Dim wordArtFormat As MsoFillFormat = wordart.FillFormat 'Set the color wordArtFormat.ForeColor = System.Drawing.Color.Red 'Set the transparency wordArtFormat.Transparency = 0.9 'Make the line invisible Dim lineFormat As MsoLineFormat = wordart.LineFormat lineFormat.IsVisible = False 'Save the file workbook.Save("e:\test2\Watermarkt_Test.xls")
相关文章推荐
- Aspose.Cells使用方法大全(基本操作+转换+导出+水印添加+工作表合并)
- 使用Aspose.Cells将工作表保存为不同的PDF文件
- 使用Aspose.Cells合并多个工作表
- Aspose.Cells基础使用方法整理
- c# winForm使用Aspose.Cells读取CSV文件中文乱码问题
- PHP 使用 Imagick 裁切/生成缩略图/添加水印自动检测和处理 GIF
- 使用Aspose.Cells的基础知识整理
- WinForm使用Aspose.cells利用模板导出Excel
- asp.net中给TextBox文本框添加水印,不影响正常使用
- GdPicture.NET使用教程:在PDF文件中添加水印
- PHP图片处理之使用imagecopy函数添加图片水印实例
- 使用ASPJPEG添加水印的方法
- 使用Aspose.Cells的基础知识整理
- Aspose.Cells 使用汇总
- 又拍云常见使用问题(如何添加和设置水印图片)
- 使用Aspose.Cells 过程中用过的知识(转)
- Aspose.Cells使用方法总结大全
- 使用ASPJPEG添加水印
- 使用java 给指定图片添加(水印)文字(不需要导入多余jar包)
- 使用ASPJPEG添加水印的方法