Picture
- class Picture
The picture object is a member of the
picturescollection:>>> import xlwings as xw >>> sheet = xw.books['Book1'].sheets[0] >>> sheet.pictures[0] # or sheet.charts['PictureName'] <Picture 'Picture 1' in Sheet1>
在 0.9.0 版的變更.
- property api: Any
Returns the native object (
pywin32orappscriptobj) of the engine being used.在 0.9.0 版被加入.
- property height: float
Returns or sets the number of points that represent the height of the picture.
在 0.5.0 版被加入.
- property left: float
Returns or sets the number of points that represent the horizontal position of the picture.
在 0.5.0 版被加入.
- property lock_aspect_ratio: bool
Truewill keep the original proportion,Falsewill allow you to change height and width independently of each other (read/write).在 0.24.0 版被加入.
- property parent: Sheet
Returns the parent of the picture.
在 0.9.0 版被加入.
- property top: float
Returns or sets the number of points that represent the vertical position of the picture.
在 0.5.0 版被加入.
- update(image, format=None, export_options=None)
Replaces an existing picture with a new one, taking over the attributes of the existing picture.
- 參數:
image (str | PathLike[str] | Any) -- Either a filepath or a Matplotlib figure object.
format (str | None) -- See under
Pictures.add()export_options (dict[str, Any] | None) -- See under
Pictures.add()
- 回傳型別:
在 0.5.0 版被加入.