Class PolyObj
A class that represents a bordered and/or filled polygon object on
the graph. A list of Poly
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class PolyObj : BoxObj, ICloneable, ISerializable
Constructors
| Improve this Doc View SourcePolyObj()
A default constructor that creates a Poly
Declaration
public PolyObj()
PolyObj(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected PolyObj(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
Serialization |
info | A Serialization |
Streaming |
context | A Streaming |
PolyObj(PointD[])
A constructor that allows the position
of the Poly
Declaration
public PolyObj(PointD[] points)
Parameters
Type | Name | Description |
---|---|---|
Point |
points | The Point |
PolyObj(PointD[], Color, Color)
A constructor that allows the position, border color, and solid fill color
of the Poly
Declaration
public PolyObj(PointD[] points, Color borderColor, Color fillColor)
Parameters
Type | Name | Description |
---|---|---|
Point |
points | The Point |
Color | borderColor | An arbitrary Color specification for the box border |
Color | fillColor | An arbitrary Color specification for the box fill (will be a solid color fill) |
PolyObj(PointD[], Color, Color, Color)
A constructor that allows the position, border color, and two-color
gradient fill colors
of the Poly
Declaration
public PolyObj(PointD[] points, Color borderColor, Color fillColor1, Color fillColor2)
Parameters
Type | Name | Description |
---|---|---|
Point |
points | The Point |
Color | borderColor | An arbitrary Color specification for the box border |
Color | fillColor1 | An arbitrary Color specification for the start of the box gradient fill |
Color | fillColor2 | An arbitrary Color specification for the end of the box gradient fill |
PolyObj(PolyObj)
The Copy Constructor
Declaration
public PolyObj(PolyObj rhs)
Parameters
Fields
| Improve this Doc View Sourceschema3
Current schema value that defines the version of the serialized file
Declaration
public const int schema3 = 11
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceIsClosedFigure
Gets or sets a value that determines if the polygon will be automatically closed. true to close the figure, false to leave it "open."
Declaration
public bool IsClosedFigure { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This boolean determines whether or not the CloseFigure() method will be called to fully close the path of the polygon. This value defaults to true, and for any closed figure it should fine. If you want to draw a line that does not close into a shape, then you should set this value to false. For a figure that is naturally closed (e.g., the first point of the polygon is the same as the last point), leaving this value set to false may result in minor pixel artifacts due to rounding.
Points
Gets or sets the Point
Declaration
public PointD[] Points { get; set; }
Property Value
Type | Description |
---|---|
Point |
Methods
| Improve this Doc View SourceClone()
Typesafe, deep-copy clone method.
Declaration
public PolyObj Clone()
Returns
Type | Description |
---|---|
Poly |
A new, independent copy of this class |
Draw(Graphics, PaneBase, Single)
Render this object to the specified Graphics device.
Declaration
public override void Draw(Graphics g, PaneBase pane, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Pane |
pane | A reference to the Pane |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and
passed down by the parent Graph |
Overrides
Remarks
This method is normally only called by the Draw method
of the parent Graph
GetObjectData(SerializationInfo, StreamingContext)
Populates a Serialization
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
Serialization |
info | A Serialization |
Streaming |
context | A Streaming |
Overrides
| Improve this Doc View SourcePointInBox(PointF, PaneBase, Graphics, Single)
Determine if the specified screen point lies inside the bounding box of this
Poly
Declaration
public override bool PointInBox(PointF pt, PaneBase pane, Graphics g, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Point |
pt | The screen point, in pixels |
Pane |
pane | A reference to the Pane |
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and
passed down by the parent Graph |
Returns
Type | Description |
---|---|
Boolean | true if the point lies in the bounding box, false otherwise |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |