Search Results for

    Show / Hide Table of Contents

    Class TextObj

    A class that represents a text object on the graph. A list of GraphObj objects is maintained by the GraphObjList collection class.

    Inheritance
    Object
    GraphObj
    TextObj
    Implements
    ICloneable
    ISerializable
    Inherited Members
    GraphObj._location
    GraphObj._isVisible
    GraphObj._isClippedToChartRect
    GraphObj.Tag
    GraphObj.Location
    GraphObj.ZOrder
    GraphObj.IsVisible
    GraphObj.IsClippedToChartRect
    GraphObj.Link
    GraphObj.IsInFrontOfData
    GraphObj.schema
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: ZedGraph
    Assembly: ZedGraph.dll
    Syntax
    [Serializable]
    public class TextObj : GraphObj, ICloneable, ISerializable

    Constructors

    | Improve this Doc View Source

    TextObj()

    Parameterless constructor that initializes a new TextObj.

    Declaration
    public TextObj()
    | Improve this Doc View Source

    TextObj(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected TextObj(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    SerializationInfo info

    A SerializationInfo instance that defines the serialized data

    StreamingContext context

    A StreamingContext instance that contains the serialized data

    | Improve this Doc View Source

    TextObj(String, Double, Double)

    Constructor that sets all TextObj properties to default values as defined in the TextObj.Default class.

    Declaration
    public TextObj(string text, double x, double y)
    Parameters
    Type Name Description
    String text

    The text to be displayed.

    Double x

    The x position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignH property.

    Double y

    The y position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignV property.

    | Improve this Doc View Source

    TextObj(String, Double, Double, CoordType)

    Constructor that sets all TextObj properties to default values as defined in the TextObj.Default class.

    Declaration
    public TextObj(string text, double x, double y, CoordType coordType)
    Parameters
    Type Name Description
    String text

    The text to be displayed.

    Double x

    The x position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignH property.

    Double y

    The y position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignV property.

    CoordType coordType

    The CoordType enum value that indicates what type of coordinate system the x and y parameters are referenced to.

    | Improve this Doc View Source

    TextObj(String, Double, Double, CoordType, AlignH, AlignV)

    Constructor that sets all TextObj properties to default values as defined in the TextObj.Default class.

    Declaration
    public TextObj(string text, double x, double y, CoordType coordType, AlignH alignH, AlignV alignV)
    Parameters
    Type Name Description
    String text

    The text to be displayed.

    Double x

    The x position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignH property.

    Double y

    The y position of the text. The units of this position are specified by the CoordinateFrame property. The text will be aligned to this position based on the AlignV property.

    CoordType coordType

    The CoordType enum value that indicates what type of coordinate system the x and y parameters are referenced to.

    AlignH alignH

    The AlignH enum that specifies the horizontal alignment of the object with respect to the (x,y) location

    AlignV alignV

    The AlignV enum that specifies the vertical alignment of the object with respect to the (x,y) location

    | Improve this Doc View Source

    TextObj(TextObj)

    The Copy Constructor

    Declaration
    public TextObj(TextObj rhs)
    Parameters
    Type Name Description
    TextObj rhs

    The TextObj object from which to copy

    Fields

    | Improve this Doc View Source

    schema2

    Current schema value that defines the version of the serialized file

    Declaration
    public const int schema2 = 10
    Field Value
    Type Description
    Int32

    Properties

    | Improve this Doc View Source

    FontSpec

    Gets a reference to the FontSpec class used to render this TextObj

    Declaration
    public FontSpec FontSpec { get; set; }
    Property Value
    Type Description
    FontSpec
    See Also
    FontColor
    FontBold
    FontItalic
    FontUnderline
    FontFamily
    FontSize
    | Improve this Doc View Source

    LayoutArea

    Declaration
    public SizeF LayoutArea { get; set; }
    Property Value
    Type Description
    SizeF
    | Improve this Doc View Source

    Text

    The TextObj to be displayed. This text can be multi-line by including newline ('\n') characters between the lines.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    String

    Methods

    | Improve this Doc View Source

    Clone()

    Typesafe, deep-copy clone method.

    Declaration
    public TextObj Clone()
    Returns
    Type Description
    TextObj

    A new, independent copy of this class

    | Improve this Doc View Source

    Draw(Graphics, PaneBase, Single)

    Render this TextObj object to the specified Graphics device This method is normally only called by the Draw method of the parent GraphObjList collection object.

    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.

    PaneBase pane

    A reference to the PaneBase object that is the parent or owner of this object.

    Single scaleFactor

    The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph.

    Overrides
    GraphObj.Draw(Graphics, PaneBase, Single)
    | Improve this Doc View Source

    GetCoords(PaneBase, Graphics, Single, out String, out String)

    Determines the shape type and Coords values for this GraphObj

    Declaration
    public override void GetCoords(PaneBase pane, Graphics g, float scaleFactor, out string shape, out string coords)
    Parameters
    Type Name Description
    PaneBase pane
    Graphics g
    Single scaleFactor
    String shape
    String coords
    Overrides
    GraphObj.GetCoords(PaneBase, Graphics, Single, out String, out String)
    | Improve this Doc View Source

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a SerializationInfo instance with the data needed to serialize the target object

    Declaration
    [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    SerializationInfo info

    A SerializationInfo instance that defines the serialized data

    StreamingContext context

    A StreamingContext instance that contains the serialized data

    Overrides
    GraphObj.GetObjectData(SerializationInfo, StreamingContext)
    | Improve this Doc View Source

    PointInBox(PointF, PaneBase, Graphics, Single)

    Determine if the specified screen point lies inside the bounding box of this TextObj. This method takes into account rotation and alignment parameters of the text, as specified in the FontSpec.

    Declaration
    public override bool PointInBox(PointF pt, PaneBase pane, Graphics g, float scaleFactor)
    Parameters
    Type Name Description
    PointF pt

    The screen point, in pixels

    PaneBase pane

    A reference to the PaneBase object that is the parent or owner of this object.

    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 GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph.

    Returns
    Type Description
    Boolean

    true if the point lies in the bounding box, false otherwise

    Overrides
    GraphObj.PointInBox(PointF, PaneBase, Graphics, Single)

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICloneable.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

    Implements

    System.ICloneable
    System.Runtime.Serialization.ISerializable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX