在 PHP 中设置 Visio 形状的线数据

Aspose.Diagram - 设置 Visio 形状的线数据

设置 Visio 形状的线数据使用Aspose.Diagram Java 用于 PHP 只需调用设置形状线数据模块。在这里您可以看到示例代码。

PHP代码

 # Create instance of Diagram

$diagram = new Diagram($dataDir."Drawing.vsd");

$shapes = $diagram->getPages()->getPage(0)->getShapes();

$i=0;

while ($i<(int)(string)$shapes->getCount()) {

$shape = $shapes->get($i);

if ($shape->getNameU() == "rectangle" && (int)(string)$shape->getID() == 1) {

$shape->getLine()->getLineColor()->setValue($diagram->getPages()->getPage(0)->getShapes()->getShape(1)->getFill()->getFillForegnd()->getValue());

$shape->getLine()->getLineWeight()->setValue(0.07041666666666667);

$shape->getLine()->getRounding()->setValue(0.1);

}

$i += 1;

}

\# Save diagram

$saveFileFormat=new SaveFileFormat();

$diagram->save($dataDir."SetShapeLineData.vdx", $saveFileFormat->VDX);

print "Set visio shape's line data.".PHP_EOL;

}

下载运行代码

下载**设置 Visio 形状的线数据 (Aspose.Diagram)**来自以下任何社交编码网站: