قم بإنشاء صورة شفافة لورقة عمل Excel

Contents
[ ]

في صورة ورقة العمل التالية ، لم يتم تطبيق الشفافية. يتم رسم الخلايا التي لا تحتوي على ألوان تعبئة باللون الأبيض.

الإخراج بدون شفافية: خلفية الخلية بيضاء
ما يجب القيام به: image_بديل_نص

بينما ، في صورة ورقة العمل التالية ، تم تطبيق الشفافية. الخلايا التي لا تحتوي على ألوان تعبئة شفافة.

الإخراج مع تمكين الشفافية
ما يجب القيام به: image_بديل_نص

يُنشئ نموذج التعليمات البرمجية التالي صورة شفافة من ورقة عمل Excel.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Create workbook object from source file
Workbook wb = new Workbook(sourceDir + "sampleCreateTransparentImage.xlsx");
// Apply different image or print options
var imgOption = new ImageOrPrintOptions();
imgOption.ImageType = Drawing.ImageType.Png;
imgOption.HorizontalResolution = 200;
imgOption.VerticalResolution = 200;
imgOption.OnePagePerSheet = true;
// Apply transparency to the output image
imgOption.Transparent = true;
// Create image after apply image or print options
var sr = new SheetRender(wb.Worksheets[0], imgOption);
sr.ToImage(0, outputDir + "outputCreateTransparentImage.png");