Excel Çalışma Sayfasının Saydam Görüntüsünü Oluşturun

Contents
[ ]

Aşağıdaki çalışma sayfası görüntüsünde saydamlık uygulanmamıştır. Dolgu renkleri olmayan hücreler beyaz olarak çizilir.

Şeffaflık olmadan çıktı: hücre arka planı beyazdır
yapılacaklar:resim_alternatif_metin

Aşağıdaki çalışma sayfası görüntüsünde ise şeffaflık uygulanmıştır. Dolgu rengi olmayan hücreler şeffaftır.

Şeffaflık etkinleştirilmiş çıktı
yapılacaklar:resim_alternatif_metin

Aşağıdaki örnek kod, bir Excel çalışma sayfasından saydam bir görüntü oluşturur.

// 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");