Search Results for

    Show / Hide Table of Contents

    Class Location

    A class than contains information about the position of an object on the graph.

    Inheritance
    Object
    Location
    Implements
    ICloneable
    ISerializable
    Inherited Members
    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 Location : ICloneable, ISerializable

    Constructors

    | Improve this Doc View Source

    Location()

    Default constructor for the Location class.

    Declaration
    public Location()
    | Improve this Doc View Source

    Location(Double, Double, Double, Double, CoordType, AlignH, AlignV)

    Constructor for the Location class that specifies the (x, y), (width, height), and the CoordType.

    Declaration
    public Location(double x, double y, double width, double height, CoordType coordType, AlignH alignH, AlignV alignV)
    Parameters
    Type Name Description
    Double x

    The x position, specified in units of .

    Double y

    The y position, specified in units of .

    Double width

    The width, specified in units of .

    Double height

    The height, specified in units of .

    CoordType coordType

    The CoordType enum that specifies the units for and

    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

    Remarks

    The (x,y) position corresponds to the starting position, the (x2, y2) coorresponds to the ending position (typically used for ArrowObj's).

    | Improve this Doc View Source

    Location(Double, Double, CoordType)

    Constructor for the Location class that specifies the x, y position and the CoordType.

    Declaration
    public Location(double x, double y, CoordType coordType)
    Parameters
    Type Name Description
    Double x

    The x position, specified in units of .

    Double y

    The y position, specified in units of .

    CoordType coordType

    The CoordType enum that specifies the units for and

    Remarks

    The (x,y) position corresponds to the top-left corner;

    | Improve this Doc View Source

    Location(Double, Double, CoordType, AlignH, AlignV)

    Constructor for the Location class that specifies the x, y position and the CoordType.

    Declaration
    public Location(double x, double y, CoordType coordType, AlignH alignH, AlignV alignV)
    Parameters
    Type Name Description
    Double x

    The x position, specified in units of .

    Double y

    The y position, specified in units of .

    CoordType coordType

    The CoordType enum that specifies the units for and

    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

    Remarks

    The (x,y) position corresponds to the top-left corner;

    | Improve this Doc View Source

    Location(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected Location(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

    Location(Location)

    The Copy Constructor

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

    The Location object from which to copy

    Fields

    | Improve this Doc View Source

    schema

    Current schema value that defines the version of the serialized file

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

    Properties

    | Improve this Doc View Source

    AlignH

    A horizontal alignment parameter for this object specified using the AlignH enum type.

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

    AlignV

    A vertical alignment parameter for this object specified using the AlignV enum type.

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

    BottomRight

    The bottom-right PointF for this Location.

    Declaration
    public PointF BottomRight { get; }
    Property Value
    Type Description
    PointF

    A PointF in CoordinateFrame units.

    Remarks

    Note that this method reduces the precision of the location coordinates from double precision to single precision. In some cases, such as Date, it may affect the resolution of the point location.

    | Improve this Doc View Source

    CoordinateFrame

    The coordinate system to be used for defining the object position

    Declaration
    public CoordType CoordinateFrame { get; set; }
    Property Value
    Type Description
    CoordType

    The coordinate system is defined with the CoordType enum

    | Improve this Doc View Source

    Height

    The height of the object.

    Declaration
    public double Height { get; set; }
    Property Value
    Type Description
    Double
    Remarks

    The units of this position are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    Rect

    The RectangleF for this object as defined by the X, Y, Width, and Height properties.

    Declaration
    public RectangleF Rect { get; set; }
    Property Value
    Type Description
    RectangleF

    A RectangleF in CoordinateFrame units.

    Remarks

    Note that this method reduces the precision of the location coordinates from double precision to single precision. In some cases, such as Date, it may affect the resolution of the point location.

    | Improve this Doc View Source

    TopLeft

    The top-left PointF for this Location.

    Declaration
    public PointF TopLeft { get; set; }
    Property Value
    Type Description
    PointF

    A PointF in CoordinateFrame units.

    Remarks

    Note that this method reduces the precision of the location coordinates from double precision to single precision. In some cases, such as Date, it may affect the resolution of the point location.

    | Improve this Doc View Source

    Width

    The width of the object.

    Declaration
    public double Width { get; set; }
    Property Value
    Type Description
    Double
    Remarks

    The units of this position are specified by the CoordinateFrame property.

    | Improve this Doc View Source

    X

    The x position of the object.

    Declaration
    public double X { get; set; }
    Property Value
    Type Description
    Double
    Remarks

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

    | Improve this Doc View Source

    X1

    The x1 position of the object (an alias for the x position).

    Declaration
    public double X1 { get; set; }
    Property Value
    Type Description
    Double
    Remarks

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

    | Improve this Doc View Source

    X2

    The x2 position of the object.

    Declaration
    public double X2 { get; }
    Property Value
    Type Description
    Double
    Remarks

    The units of this position are specified by the CoordinateFrame property. The object will be aligned to this position based on the AlignH property. This position is only used for objects such as ArrowObj, where it makes sense to have a second coordinate. Note that the X2 position is stored internally as a Width offset from X.

    | Improve this Doc View Source

    Y

    The y position of the object.

    Declaration
    public double Y { get; set; }
    Property Value
    Type Description
    Double
    Remarks

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

    | Improve this Doc View Source

    Y1

    The y1 position of the object (an alias for the y position).

    Declaration
    public double Y1 { get; set; }
    Property Value
    Type Description
    Double
    Remarks

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

    | Improve this Doc View Source

    Y2

    The y2 position of the object.

    Declaration
    public double Y2 { get; }
    Property Value
    Type Description
    Double
    Remarks

    The units of this position are specified by the CoordinateFrame property. The object will be aligned to this position based on the AlignV property. This position is only used for objects such as ArrowObj, where it makes sense to have a second coordinate. Note that the Y2 position is stored internally as a Height offset from Y.

    Methods

    | Improve this Doc View Source

    Clone()

    Typesafe, deep-copy clone method.

    Declaration
    public Location Clone()
    Returns
    Type Description
    Location

    A new, independent copy of this class

    | 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 virtual 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

    | Improve this Doc View Source

    Transform(PaneBase)

    Transform this Location object to display device coordinates using the properties of the specified GraphPane.

    Declaration
    public PointF Transform(PaneBase pane)
    Parameters
    Type Name Description
    PaneBase pane

    A reference to the PaneBase object that contains the Axis classes which will be used for the transform.

    Returns
    Type Description
    PointF

    A point in display device coordinates that corresponds to the specified user point.

    | Improve this Doc View Source

    Transform(PaneBase, Double, Double, CoordType)

    Transform a data point from the specified coordinate type (CoordType) to display device coordinates (pixels).

    Declaration
    public static PointF Transform(PaneBase pane, double x, double y, CoordType coord)
    Parameters
    Type Name Description
    PaneBase pane

    A reference to the PaneBase object that contains the Axis classes which will be used for the transform.

    Double x

    The x coordinate that defines the point in user space.

    Double y

    The y coordinate that defines the point in user space.

    CoordType coord

    A CoordType type that defines the coordinate system in which the X,Y pair is defined.

    Returns
    Type Description
    PointF

    A point in display device coordinates that corresponds to the specified user point.

    Remarks

    If is not of type GraphPane, then only the PaneFraction transformation is available.

    | Improve this Doc View Source

    TransformBottomRight(PaneBase)

    The PointF for this object as defined by the X2 and Y2 properties.

    Declaration
    public PointF TransformBottomRight(PaneBase pane)
    Parameters
    Type Name Description
    PaneBase pane
    Returns
    Type Description
    PointF

    A PointF in pixel units.

    Remarks

    This method transforms the location to output device pixel units. The AlignH and AlignV properties are ignored for this transformation (see TransformTopLeft(PaneBase, Single, Single)).

    | Improve this Doc View Source

    TransformRect(PaneBase)

    Transform the RectangleF for this object as defined by the X, Y, Width, and Height properties.

    Declaration
    public RectangleF TransformRect(PaneBase pane)
    Parameters
    Type Name Description
    PaneBase pane
    Returns
    Type Description
    RectangleF

    A RectangleF in pixel units.

    Remarks

    This method transforms the location to output device pixel units. The AlignH and AlignV properties are honored in this transformation.

    | Improve this Doc View Source

    TransformTopLeft(PaneBase)

    The PointF for this object as defined by the X and Y properties.

    Declaration
    public PointF TransformTopLeft(PaneBase pane)
    Parameters
    Type Name Description
    PaneBase pane
    Returns
    Type Description
    PointF

    A PointF in pixel units.

    Remarks

    This method transforms the location to output device pixel units. The AlignH and AlignV properties are ignored for this transformation (see TransformTopLeft(PaneBase, Single, Single)).

    | Improve this Doc View Source

    TransformTopLeft(PaneBase, Single, Single)

    Transform this Location from the coordinate system as specified by CoordinateFrame to the device coordinates of the specified PaneBase object.

    Declaration
    public PointF TransformTopLeft(PaneBase pane, float width, float height)
    Parameters
    Type Name Description
    PaneBase pane

    A reference to the PaneBase object that contains the Axis classes which will be used for the transform.

    Single width

    The width of the object in device pixels

    Single height

    The height of the object in device pixels

    Returns
    Type Description
    PointF

    The top-left corner of the object

    Remarks

    The returned PointF struct represents the top-left corner of the object that honors the Location properties. The AlignH and AlignV properties are honored in this transformation.

    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