تحويل إكسل إلى صورة عالية الدقة
مع تزايد انتشار الشاشات عالية الدقة، غالبًا ما تظهر الصور التي تنتج عند 96 DPI الافتراضية غير واضحة وغير حادة. لضمان الوضوح على الشاشات عالية الدقة، من الضروري إنشاء صور بدقة أعلى. تقدم Aspose.Cells ميزة لتعيين ImageOrPrintOptions.HorizontalResolution و ImageOrPrintOptions.VerticalResolution، مما يسمح لك بإنشاء صور عالية الجودة من ملفات إكسل تظهر بشكل واضح على الشاشات عالية الدقة.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// 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 | |
HorizontalResolution = 300, | |
VerticalResolution = 300, | |
// Set the image type | |
ImageType = ImageType.Png, | |
}; | |
// Get the worksheet | |
Worksheet sheet = workbook.Worksheets[0]; | |
// Create a SheetRender instance | |
SheetRender render = new SheetRender(sheet, options); | |
// Generate and save the image | |
render.ToImage(0, "output.png"); |