horizontal_resolution proprietà

horizontal_resolution proprietà

Ottiene o imposta la risoluzione orizzontale delle immagini generate, in punti per pollice.

Osservazioni

Il valore predefinito è 96.

Impostazione ImageOrPrintOptions.horizontal_resolution e ImageOrPrintOptions.vertical_resolution influisce sulla larghezza e l’altezza dell’immagine in output in pixel.

Esempio

Il codice seguente imposta la risoluzione a 192, la larghezza e l’altezza dell’immagine generata sono il doppio di quello con risoluzione lasciata come valore predefinito 96.

from aspose.cells import Workbook
from aspose.cells.drawing import ImageType
from aspose.cells.rendering import ImageOrPrintOptions, SheetRender

wb = Workbook("Book1.xlsx")
opts = ImageOrPrintOptions()
# Set output image type: png.
opts.image_type = ImageType.PNG
# Set resolution to 192.
opts.horizontal_resolution = 192
opts.vertical_resolution = 192
# Render worksheet page to image.
sr = SheetRender(wb.worksheets[0], opts)
sr.to_image(0, "Sheet_Page1.png")

Definizione:

@property
def horizontal_resolution(self):
    ...
@horizontal_resolution.setter
def horizontal_resolution(self, value):
    ...

Guarda anche