跳到主要内容

PointsToPicas

将磅转换为派卡(1 派卡 = 12 磅)。

语法

expression.PointsToPicas(pt);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
pt必需number要转换为派卡的磅数。

返回值

number

示例

此示例展示如何将磅转换为派卡。

const points = 42;
const picas = Api.PointsToPicas(points);

const rgb = Api.RGB(50, 150, 250);
const fill = Api.CreateSolidFill(rgb);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape('rect', 300 * 36000, 150 * 36000, fill, stroke);
const paragraph = shape.GetContent().GetElement(0);
paragraph.AddText(points + ' points are equal to ' + picas + ' picas.');

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
slide.AddObject(shape);