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


C# UserModel.HSSFShape类代码示例

本文整理汇总了C#中NPOI.HSSF.UserModel.HSSFShape的典型用法代码示例。如果您正苦于以下问题:C# HSSFShape类的具体用法?C# HSSFShape怎么用?C# HSSFShape使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HSSFShape类属于NPOI.HSSF.UserModel命名空间,在下文中一共展示了HSSFShape类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HSSFTextbox

 /// <summary>
 /// Construct a new textbox with the given parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
 public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     HorizontalAlignment = HorizontalTextAlignment.Left;
     VerticalAlignment = VerticalTextAlignment.Top;
     this.String = (new HSSFRichTextString(""));
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:12,代码来源:HSSFTextbox.cs

示例2: HSSFPicture

 /// <summary>
 /// Constructs a picture object.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     base.ShapeType = (OBJECT_TYPE_PICTURE);
     CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
     cod.ObjectType = CommonObjectType.PICTURE;
 }
开发者ID:WPG,项目名称:npoi,代码行数:12,代码来源:HSSFPicture.cs

示例3: CreateObjRecord

        /// <summary>
        /// Creates the low level OBJ record for this shape.
        /// </summary>
        /// <param name="hssfShape">The HSSFShape.</param>
        /// <param name="shapeId">The shape id.</param>
        /// <returns></returns>
        private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId)
        {
            HSSFShape shape = hssfShape;

            ObjRecord obj = new ObjRecord();
            CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
            c.ObjectType=(CommonObjectType)((HSSFSimpleShape)shape).ShapeType;
            //        c.ObjectId((short) ( 1 ));
            c.ObjectId=((short)(shapeId));
            c.IsLocked=true;
            c.IsPrintable=true;
            c.IsAutoFill=true;
            c.IsAutoline=true;
            //        c.Reserved2( 0x012C0A84 );
            c.Reserved2=(0x0);
            //        UnknownRecord sub1 = new UnknownRecord( (short)0x7, (short)0x2, new byte[] { 0x09, 0x00 } );
            //        UnknownRecord sub2 = new UnknownRecord( (short)0x8, (short)0x2, new byte[] { 0x01, 0x00 } );
            EndSubRecord e = new EndSubRecord();

            obj.AddSubRecord(c);
            //        obj.AddSubRecord( sub1 );
            //        obj.AddSubRecord( sub2 );
            obj.AddSubRecord(e);

            return obj;
        }
开发者ID:babywzazy,项目名称:Server,代码行数:32,代码来源:PictureShape.cs

示例4: HSSFTextbox

        /// <summary>
        /// Construct a new textbox with the given parent and anchor.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
        public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            HorizontalAlignment = (HORIZONTAL_ALIGNMENT_LEFT);
            VerticalAlignment = (VERTICAL_ALIGNMENT_TOP);
            this.String = (new HSSFRichTextString(""));
        }
开发者ID:WPG,项目名称:npoi,代码行数:13,代码来源:HSSFTextbox.cs

示例5: HSSFCombobox

        public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            base.ShapeType = (OBJECT_TYPE_COMBO_BOX);
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
            cod.ObjectType = CommonObjectType.ComboBox;
        }
开发者ID:89sos98,项目名称:npoi,代码行数:8,代码来源:HSSFCombobox.cs

示例6: HSSFTextbox

        /// <summary>
        /// Construct a new textbox with the given parent and anchor.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
        public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor):base(parent, anchor)
        {
            
            ShapeType = (OBJECT_TYPE_TEXT);

            halign = HORIZONTAL_ALIGNMENT_LEFT;
            valign = VERTICAL_ALIGNMENT_TOP;
        }
开发者ID:uwitec,项目名称:web-mvc-logistics,代码行数:13,代码来源:HSSFTextbox.cs

示例7: HSSFComment

        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            this.ShapeType = (OBJECT_TYPE_COMMENT);

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            visible = false;

            author = "";
        }
开发者ID:babywzazy,项目名称:Server,代码行数:18,代码来源:HSSFComment.cs

示例8: HSSFComment

        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            _note = CreateNoteRecord();

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            Visible = false;

            Author = "";
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
            cod.ObjectType = CommonObjectType.COMMENT; 
        }
开发者ID:WPG,项目名称:npoi,代码行数:20,代码来源:HSSFComment.cs

示例9: CreateShape

 /// <summary>
 /// Create a new shape object used to Create the escher records.
 /// </summary>
 /// <param name="hssfShape">The simple shape this Is based on.</param>
 /// <param name="shapeId">The shape id.</param>
 /// <returns></returns>
 public static AbstractShape CreateShape(HSSFShape hssfShape, int shapeId)
 {
     AbstractShape shape;
     if (hssfShape is HSSFComment)
     {
         shape = new CommentShape((HSSFComment)hssfShape, shapeId);
     }
     else if (hssfShape is HSSFTextbox)
     {
         shape = new TextboxShape((HSSFTextbox)hssfShape, shapeId);
     }
     else if (hssfShape is HSSFPolygon)
     {
         shape = new PolygonShape((HSSFPolygon)hssfShape, shapeId);
     }
     else if (hssfShape is HSSFSimpleShape)
     {
         HSSFSimpleShape simpleShape = (HSSFSimpleShape)hssfShape;
         switch (simpleShape.ShapeType)
         {
             case HSSFSimpleShape.OBJECT_TYPE_PICTURE:
                 shape = new PictureShape(simpleShape, shapeId);
                 break;
             case HSSFSimpleShape.OBJECT_TYPE_LINE:
                 shape = new LineShape(simpleShape, shapeId);
                 break;
             case HSSFSimpleShape.OBJECT_TYPE_OVAL:
             case HSSFSimpleShape.OBJECT_TYPE_RECTANGLE:
                 shape = new SimpleFilledShape(simpleShape, shapeId);
                 break;
             case HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX:
                 shape = new ComboboxShape(simpleShape, shapeId);
                 break;
             default:
                 throw new ArgumentException("Do not know how to handle this type of shape");
         }
     }
     else
     {
         throw new ArgumentException("Unknown shape type");
     }
     EscherSpRecord sp = (EscherSpRecord)shape.SpContainer.GetChildById(EscherSpRecord.RECORD_ID);
     if (hssfShape.Parent!= null)
         sp.Flags=sp.Flags | EscherSpRecord.FLAG_CHILD;
     return shape;
 }
开发者ID:xiepeixing,项目名称:npoi,代码行数:52,代码来源:AbstractShape.cs

示例10: CreateObjRecord

        /// <summary>
        /// Creates the low level OBJ record for this shape.
        /// </summary>
        /// <param name="hssfShape">The HSSF shape.</param>
        /// <param name="shapeId">The shape id.</param>
        /// <returns></returns>
        private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId)
        {
            HSSFShape shape = hssfShape;

            ObjRecord obj = new ObjRecord();
            CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
            c.ObjectType=(CommonObjectType)((HSSFSimpleShape)shape).ShapeType;
            c.ObjectId=((short)(shapeId));
            c.IsLocked=(true);
            c.IsPrintable=(true);
            c.IsAutoFill=(true);
            c.IsAutoline=(true);
            EndSubRecord e = new EndSubRecord();

            obj.AddSubRecord(c);
            obj.AddSubRecord(e);

            return obj;
        }
开发者ID:babywzazy,项目名称:Server,代码行数:25,代码来源:LineShape.cs

示例11: CreateObjRecord

        /// <summary>
        /// Creates the lowerlevel OBJ records for this shape.
        /// </summary>
        /// <param name="hssfShape">The HSSF shape.</param>
        /// <param name="shapeId">The shape id.</param>
        /// <returns></returns>
        private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId)
        {
            HSSFShape shape = hssfShape;

            ObjRecord obj = new ObjRecord();
            CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
            c.ObjectType=CommonObjectType.MICROSOFT_OFFICE_DRAWING;
            c.ObjectId=((short)(shapeId));
            c.IsLocked=(true);
            c.IsPrintable=(true);
            c.IsAutoFill=(true);
            c.IsAutoline=(true);
            EndSubRecord e = new EndSubRecord();

            obj.AddSubRecord(c);
            obj.AddSubRecord(e);

            return obj;
        }
开发者ID:babywzazy,项目名称:Server,代码行数:25,代码来源:PolygonShape.cs

示例12: GetOptRecord

 public static EscherOptRecord GetOptRecord(HSSFShape shape)
 {
     return shape.GetOptRecord();
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:4,代码来源:HSSFTestHelper.cs

示例13: SetShapeId

 public static void SetShapeId(HSSFShape shape, int id)
 {
     shape.ShapeId = (id);
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:4,代码来源:HSSFTestHelper.cs

示例14: HSSFPicture

        /// <summary>
        /// Constructs a picture object.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">The anchor.</param>
        public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            this.ShapeType = (OBJECT_TYPE_PICTURE);
        }
开发者ID:xiepeixing,项目名称:npoi,代码行数:11,代码来源:HSSFPicture.cs

示例15: GetObjRecord

 public static ObjRecord GetObjRecord(HSSFShape shape)
 {
     return shape.GetObjRecord();
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:4,代码来源:HSSFTestHelper.cs


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