Excel を高解像度画像に変換する
Contents
[
Hide
]
高解像度画面の普及に伴い、デフォルトの96 DPIで生成された画像はぼやけて不明瞭に見えることがよくあります。高解像度の画面ではクリアな画像を生成するために、より高い DPI で画像を生成することが重要です。Aspose.Cellsでは、Excelファイルから高品質の画像を作成できる機能を提供し、高解像度ディスプレイ上で鮮明に表示される画像を作成できます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |