Excel i Yüksek Çözünürlüklü Görüntüye Dönüştür

Contents
[ ]

Yüksek çözünürlüklü ekranların artan yaygınlığı ile, varsayılan 96 DPI’da oluşturulan görüntüler genellikle belirsiz ve bulanık görünür. Yüksek çözünürlüklü ekranlarda netlik sağlamak için, görüntüleri daha yüksek bir DPI’da oluşturmak önemlidir. Aspose.Cells, Excel dosyalarından keskin görünen yüksek kaliteli görüntüler oluşturmanıza olanak tanıyan ImageOrPrintOptions.HorizontalResolution ve ImageOrPrintOptions.VerticalResolution ayarlarını yapmanın işlevselliğini sunar.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Load the Excel file
Workbook workbook = new Workbook("input.xlsx");
// Create an instance of ImageOrPrintOptions
ImageOrPrintOptions options = new ImageOrPrintOptions();
// Set horizontal and vertical resolution to 300 DPI
options.setHorizontalResolution(300);
options.setVerticalResolution(300);
// Set the image type
options.setImageType(ImageType.PNG);
// Get the worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
// Create a SheetRender instance
SheetRender render = new SheetRender(sheet, options);
// Generate and save the image
render.toImage(0, "output.png");