当前位置: 首页>>代码示例>>C#>>正文


C# Page.DrawRectangle方法代码示例

本文整理汇总了C#中Page.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Page.DrawRectangle方法的具体用法?C# Page.DrawRectangle怎么用?C# Page.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Page的用法示例。


在下文中一共展示了Page.DrawRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawRectangle

        /// <summary>
        /// Draw Rectangle with 2 connections points.
        /// </summary>
        public static Shape DrawRectangle(Page page, double x1, double y1, double x2, double y2)
        {
            Shape rect = page.DrawRectangle(x1, y1, x2, y2);

            // add connection point1
            short rowIndex1 = rect.AddRow(
                (short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionConnectionPts,
                (short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowLast,
                (short)Microsoft.Office.Interop.Visio.VisRowTags.visTagCnnctPt);

            Row row1 = rect.Section[(short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionConnectionPts][rowIndex1];
            row1.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctX].FormulaU = "Width*0";
            row1.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctY].FormulaU = "Height*0.5";
            row1.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctDirX].FormulaU = "1";
            row1.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctDirY].FormulaU = "0";
            row1.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctType].FormulaU =
                ((short)Microsoft.Office.Interop.Visio.tagVisCellVals.visCnnctTypeInward).ToString(CultureInfo.InvariantCulture);

            // add connection point2
            short rowIndex2 = rect.AddRow(
                (short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionConnectionPts,
                (short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowLast,
                (short)Microsoft.Office.Interop.Visio.VisRowTags.visTagCnnctPt);

            Row row2 = rect.Section[(short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionConnectionPts][rowIndex2];
            row2.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctX].FormulaU = "Width*1";
            row2.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctY].FormulaU = "Height*0.5";
            row2.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctDirX].FormulaU = "-1";
            row2.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctDirY].FormulaU = "0";
            row2.CellU[(short)Microsoft.Office.Interop.Visio.VisCellIndices.visCnnctType].FormulaU =
                ((short)Microsoft.Office.Interop.Visio.tagVisCellVals.visCnnctTypeInward).ToString(CultureInfo.InvariantCulture);

            return rect;
        }
开发者ID:abdurrm,项目名称:gedtovisio,代码行数:37,代码来源:VisioHelper.cs

示例2: CreateStandardShape

 public static Shape CreateStandardShape(Page page)
 {
     var shape = page.DrawRectangle(1, 1, 4, 3);
     var cell_width = shape.CellsU["Width"];
     var cell_height = shape.CellsU["Height"];
     cell_width.Formula = "=(1.0+2.5)";
     cell_height.Formula = "=(0.0+1.5)";
     return shape;
 }
开发者ID:modulexcite,项目名称:Visio-Code-Samples,代码行数:9,代码来源:Util.cs


注:本文中的Page.DrawRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。