original_width_cm propriété
original_width_cm propriété
Obtient la largeur originale de l’image, en unités de centimètres.
Exemple
from aspose.cells import Workbook
# Instantiating a Workbook object
workbook = Workbook()
worksheet = workbook.worksheets[0]
# Adding a picture at the location of a cell whose row and column indices are 1 in the worksheet. It is "B2" cell
imgIndex = worksheet.pictures.add(1, 1, "example.jpeg")
# Get the inserted picture object
pic = worksheet.pictures[imgIndex]
# Gets the original width of the picture.
picWidthCM = pic.original_width_cm
# Save the excel file.
workbook.save("result.xlsx")
Définition:
@property
def original_width_cm(self):
...
Voir également
- module
aspose.cells.drawing
- classe
Picture