更改Visio默认绘图单位

时间:2015-07-17 07:10:51

标签: c# visio

我正在使用带有c#的axdrawingcontrol来打开Visio。我需要将默认绘图单位(以英寸为单位)更改为点。标尺和网格已经在点上,但如果我使用例如ActivePage.DrawRectangle(1, 5, 5, 1);方法,矩形将以英寸绘制。

我尝试使用代码来更改默认单位,但它没有任何效果。我的错误在哪里?

AxDrawingControl _drawingControl;
_drawingControl.Document.Application.ActivePage.PageSheet.CellsSRC[
                    (short)VisSectionIndices.visSectionObject ,
                    (short)VisRowIndices.visRowPage,
                    (short)VisCellIndices.visPageScale
                    ].FormulaU ="1pt";
                _drawingControl.Document.Application.ActivePage.PageSheet.CellsSRC[
                    (short)VisSectionIndices.visSectionObject,
                    (short)VisRowIndices.visRowPage,
                    (short)VisCellIndices.visPageDrawingScale
                    ].FormulaU = "1pt";

1 个答案:

答案 0 :(得分:0)

Page.DrawRectangle总是以英寸为单位(又称“内部单位”),你无法改变它。

查看this topic了解详细信息和解决方法。