Class ImageObj
A class that represents an image object on the graph. A list of GraphObj objects is maintained by the GraphObjList collection class.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class ImageObj : GraphObj, ICloneable, ISerializable
Constructors
| Improve this Doc View SourceImageObj()
A default constructor that places a null Image at a default RectangleF of (0,0,1,1)
Declaration
public ImageObj()
ImageObj(Image, Double, Double, Double, Double)
A constructor that allows the Image and individual Single coordinate locations for the ImageObj to be pre-specified.
Declaration
public ImageObj(Image image, double left, double top, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
Image | image | A Image class that defines the image |
Double | left | The position of the left side of the rectangle that defines the ImageObj location. The units of this position are specified by the CoordinateFrame property. |
Double | top | The position of the top side of the rectangle that defines the ImageObj location. The units of this position are specified by the CoordinateFrame property. |
Double | width | The width of the rectangle that defines the ImageObj location. The units of this position are specified by the CoordinateFrame property. |
Double | height | The height of the rectangle that defines the ImageObj location. The units of this position are specified by the CoordinateFrame property. |
ImageObj(Image, RectangleF)
A constructor that allows the Image and RectangleF location for the ImageObj to be pre-specified.
Declaration
public ImageObj(Image image, RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
Image | image | A Image class that defines the image |
RectangleF | rect | A RectangleF struct that defines the image location, specifed in units based on the CoordinateFrame property. |
ImageObj(Image, RectangleF, CoordType, AlignH, AlignV)
A constructor that allows the Image and RectangleF location for the ImageObj to be pre-specified.
Declaration
public ImageObj(Image image, RectangleF rect, CoordType coordType, AlignH alignH, AlignV alignV)
Parameters
Type | Name | Description |
---|---|---|
Image | image | A Image class that defines the image |
RectangleF | rect | A RectangleF struct that defines the image location, specifed in units based on the CoordinateFrame 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 |
ImageObj(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected ImageObj(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 |
ImageObj(ImageObj)
The Copy Constructor
Declaration
public ImageObj(ImageObj rhs)
Parameters
Type | Name | Description |
---|---|---|
ImageObj | rhs | The ImageObj object from which to copy |
Fields
| Improve this Doc View Sourceschema2
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 SourceImage
The Image object.
Declaration
public Image Image { get; set; }
Property Value
Type | Description |
---|---|
Image | A Image class reference. |
IsScaled
Gets or sets a property that determines if the image will be scaled to the output rectangle (see Location).
Declaration
public bool IsScaled { get; set; }
Property Value
Type | Description |
---|---|
Boolean | true to scale the image, false to draw the image unscaled, but clipped to the destination rectangle |
Methods
| Improve this Doc View SourceClone()
Typesafe, deep-copy clone method.
Declaration
public ImageObj Clone()
Returns
Type | Description |
---|---|
ImageObj | A new, independent copy of this class |
Draw(Graphics, PaneBase, Single)
Render this 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
| Improve this Doc View SourceGetCoords(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
| Improve this Doc View SourceGetObjectData(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
| Improve this Doc View SourcePointInBox(PointF, PaneBase, Graphics, Single)
Determine if the specified screen point lies inside the bounding box of this ArrowObj. The bounding box is calculated assuming a distance of NearestTol pixels around the arrow segment.
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
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 |