Picture#

class Picture(impl=None)#

图片对象是 pictures 集合中的一员:

>>> import xlwings as xw
>>> sht = xw.books['Book1'].sheets[0]
>>> sht.pictures[0]  # or sht.charts['PictureName']
<Picture 'Picture 1' in <Sheet [Book1]Sheet1>>

在 0.9.0 版本发生变更.

property api#

返回正在使用的引擎的原生对象( pywin32appscript 对象)。

在 0.9.0 版本加入.

delete()#

删除图片。

在 0.5.0 版本加入.

property height#

获得或者设置图片的高度,单位是 point

在 0.5.0 版本加入.

property left#

获得或者设置图片的水平位置,单位是 point

在 0.5.0 版本加入.

property lock_aspect_ratio#

True will keep the original proportion, False will allow you to change height and width independently of each other (read/write).

在 0.24.0 版本加入.

property name#

获得或者设置图片的名字。

在 0.5.0 版本加入.

property parent#

返回图片所属的对象。

在 0.9.0 版本加入.

property top#

获得或者设置图片的垂直位置,单位是 point

在 0.5.0 版本加入.

update(image, format=None, export_options=None)#

用新的图片替换原有的图片,继承原来图片的属性。

Arguments#

imagestr or path-like object or matplotlib.figure.Figure

是文件路径名或者是Matplotlib图形对象。

formatstr, default None

See under Pictures.add()

export_optionsdict, default None

See under Pictures.add()

在 0.5.0 版本加入.

property width#

获得或者设置图片的宽度,单位是 point

在 0.5.0 版本加入.