跳到主要内容

SetPictureSize

设置内容控件中图片的大小。 如果内容控件是图片,此方法会调整图像的宽度和高度。

语法

expression.SetPictureSize(width, height);

expression - 表示 ApiInlineLvlSdt 类的变量。

参数

名称必需/可选数据类型默认值描述
width必需EMU所需的图像宽度。
height必需EMU所需的图像高度。

返回值

boolean

示例

调整文档中图片内容控件内图像的大小。

// How do I set the exact width and height of a picture content control in a document?

// Control the display dimensions of an embedded image to fit a fixed layout in a document.

let doc = Api.GetDocument();
let inlineControl = doc.AddPictureContentControl();
inlineControl.SetPictureSize(50 * 36000, 70 * 36000);