Class ShapeBase
The base class for shape objects such as ShapePoint, ShapePolyLine and ShapePolygon.
Implements
Inherited Members
Namespace: FastReport.Map
Assembly: FastReport.dll
Syntax
public class ShapeBase : Base, IDisposable, IFRSerializable, ICustomTypeDescriptor
Constructors
ShapeBase()
Initializes a new instance of the ShapeBase class.
Declaration
public ShapeBase()
Properties
CenterOffsetX
Gets or sets the center point X offset.
Declaration
public float CenterOffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Use this property to adjust the label's position.
CenterOffsetY
Gets or sets the center point Y offset.
Declaration
public float CenterOffsetY { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Use this property to adjust the label's position.
CustomStyle
Gets a custom shape style.
Declaration
public ShapeStyle CustomStyle { get; }
Property Value
| Type | Description |
|---|---|
| ShapeStyle |
Remarks
To use this property, first set the UseCustomStyle property to true.
Layer
Gets a reference to the parent Layer object.
Declaration
[Browsable(false)]
public MapLayer Layer { get; }
Property Value
| Type | Description |
|---|---|
| MapLayer |
Map
Gets a reference to the parent Map object.
Declaration
[Browsable(false)]
public MapObject Map { get; }
Property Value
| Type | Description |
|---|---|
| MapObject |
ShapeOffsetX
Gets or sets the shape X offset.
Declaration
public float ShapeOffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Use this property to adjust the shape position.
ShapeOffsetY
Gets or sets the shape Y offset.
Declaration
public float ShapeOffsetY { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Use this property to adjust the shape position.
ShapeScale
Gets or sets the scale factor for this shape.
Declaration
public float ShapeScale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Use this property to adjust the shape size.
SpatialData
Gets or sets the spatial data associated with this shape.
Declaration
[Browsable(false)]
public ShapeSpatialData SpatialData { get; set; }
Property Value
| Type | Description |
|---|---|
| ShapeSpatialData |
UseCustomStyle
Gets or sets a value indicating that custom shape style is used.
Declaration
public bool UseCustomStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
If this property is false, the layer's DefaultShapeStyle is used.
Value
Gets or sets the value.
Declaration
public double Value { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Visible
Gets or sets the shape visibility.
Declaration
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
| Type | Name | Description |
|---|---|---|
| Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
Draw(FRPaintEventArgs)
Draws the shape.
Declaration
public virtual void Draw(FRPaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| FRPaintEventArgs | e | Object that provides a data for paint event. |
DrawLabel(FRPaintEventArgs)
Draws the label.
Declaration
public virtual void DrawLabel(FRPaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| FRPaintEventArgs | e | Object that provides a data for paint event. |
FinalizeComponent()
Finalizes a component before running a report.
Declaration
public virtual void FinalizeComponent()
GetAttributes()
Declaration
public AttributeCollection GetAttributes()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.AttributeCollection |
GetClassName()
Declaration
public string GetClassName()
Returns
| Type | Description |
|---|---|
| System.String |
GetComponentName()
Declaration
public string GetComponentName()
Returns
| Type | Description |
|---|---|
| System.String |
GetConverter()
Declaration
public TypeConverter GetConverter()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.TypeConverter |
GetDefaultEvent()
Declaration
public EventDescriptor GetDefaultEvent()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.EventDescriptor |
GetDefaultProperty()
Declaration
public PropertyDescriptor GetDefaultProperty()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.PropertyDescriptor |
GetEditor(Type)
Declaration
public object GetEditor(Type editorBaseType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | editorBaseType |
Returns
| Type | Description |
|---|---|
| System.Object |
GetEvents()
Declaration
public EventDescriptorCollection GetEvents()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.EventDescriptorCollection |
GetEvents(Attribute[])
Declaration
public EventDescriptorCollection GetEvents(Attribute[] attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Attribute[] | attributes |
Returns
| Type | Description |
|---|---|
| System.ComponentModel.EventDescriptorCollection |
GetProperties()
Declaration
public PropertyDescriptorCollection GetProperties()
Returns
| Type | Description |
|---|---|
| System.ComponentModel.PropertyDescriptorCollection |
GetProperties(Attribute[])
Declaration
public PropertyDescriptorCollection GetProperties(Attribute[] attr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Attribute[] | attr |
Returns
| Type | Description |
|---|---|
| System.ComponentModel.PropertyDescriptorCollection |
GetPropertyOwner(PropertyDescriptor)
Declaration
public object GetPropertyOwner(PropertyDescriptor pd)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.PropertyDescriptor | pd |
Returns
| Type | Description |
|---|---|
| System.Object |
HitTest(PointF)
Checks if the shape is under cursor.
Declaration
public virtual bool HitTest(PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | point | The cursor coordinates. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the cursor is over the shape. |
InitializeComponent()
Initializes a component before running a report.
Declaration
public virtual void InitializeComponent()
RestoreState()
Restores the state of this component.
Declaration
public virtual void RestoreState()
SaveState()
Saves the state of this component.
Declaration
public virtual void SaveState()
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).
Simplify(Double)
Reduces the number of points in the shape.
Declaration
public virtual void Simplify(double accuracy)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | accuracy | The accuracy value. |