當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。