本文整理汇总了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(""));
}
示例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;
}
示例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;
}
示例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(""));
}
示例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;
}
示例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;
}
示例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 = "";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: GetOptRecord
public static EscherOptRecord GetOptRecord(HSSFShape shape)
{
return shape.GetOptRecord();
}
示例13: SetShapeId
public static void SetShapeId(HSSFShape shape, int id)
{
shape.ShapeId = (id);
}
示例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);
}
示例15: GetObjRecord
public static ObjRecord GetObjRecord(HSSFShape shape)
{
return shape.GetObjRecord();
}