أضف علامة WordArt المائية إلى التخطيط

إضافة علامة مائية WordArt إلى مخطط

يوضح المثال التالي كيفية إضافة شكل WordArt كعلامة مائية لمنطقة الرسم التخطيطي الموجودة. يستخدم المثال ملف Excel قالب يحتوي بالفعل على الرسم البياني.

مقارنة الصور قبل وبعد تنفيذ الكود

ملف الإدخال

ما يجب القيام به: image_بديل_نص

ملف الإخراج

ما يجب القيام به: image_بديل_نص

كود Java لإضافة علامة مائية WordArt إلى المخططات

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(AddWordArtWatermarkToChart.class) + "articles/";
// Instantiate a new workbook, Open the existing excel file.
Workbook workbook = new Workbook(dataDir + "sample.xlsx");
// Get the chart in the first worksheet.
Chart chart = workbook.getWorksheets().get(0).getCharts().get(0);
// Add a WordArt watermark (shape) to the chart's plot area.
Shape wordart = chart.getShapes().addTextEffectInChart(MsoPresetTextEffect.TEXT_EFFECT_1, "CONFIDENTIAL",
"Arial Black", 66, false, false, 1200, 500, 2000, 3000);
// Get the shape's fill format.
FillFormat wordArtFormat = wordart.getFill();
// Set the transparency.
wordArtFormat.setTransparency(0.9);
// Get the line format.
LineFormat lineFormat = wordart.getLine();
// Set Line format to invisible.
lineFormat.setWeight(0.0);
// Save the excel file.
workbook.save(dataDir + "AWArtWToC_out.xlsx");