public class ImageAreaRectangle : ImageAreaBase
Public Class ImageAreaRectangle
Inherits ImageAreaBase
public ref class ImageAreaRectangle : public ImageAreaBase
type ImageAreaRectangle =
class
inherit ImageAreaBase
end
using EWSoftware.ImageMaps;
using EWSoftware.ImageMaps.Windows.Forms;
// Example code that creates an image map and adds some image areas
ImageMap imMap = new ImageMap();
ImageAreaRectangle imageAreaRectangle1 = new ImageAreaRectangle();
ImageAreaCircle imageAreaCircle1 = new ImageAreaCircle();
ImageAreaPolygon imageAreaPolygon1 = new ImageAreaPolygon();
ImageAreaRectangle imageAreaRectangle2 = new ImageAreaRectangle();
ImageAreaEllipse imageAreaEllipse1 = new ImageAreaEllipse();
imageAreaRectangle1.AccessKey = "R";
imageAreaRectangle1.Rectangle = new System.Drawing.Rectangle(16, 16, 150, 94);
imageAreaRectangle1.TabIndex = 3;
imageAreaRectangle1.ToolTip = "A rectangle area";
imageAreaCircle1.AccessKey = "C";
imageAreaCircle1.CenterPoint = new System.Drawing.Point(380, 88);
imageAreaCircle1.Radius = 60;
imageAreaCircle1.TabIndex = 1;
imageAreaCircle1.ToolTip = "A circle area";
imageAreaPolygon1.AccessKey = "P";
imageAreaPolygon1.Points.AddRange(new System.Drawing.Point[] {
new System.Drawing.Point(42, 186),
new System.Drawing.Point(110, 286),
new System.Drawing.Point(144, 250),
new System.Drawing.Point(138, 230),
new System.Drawing.Point(160, 216),
new System.Drawing.Point(190, 214),
new System.Drawing.Point(152, 168),
new System.Drawing.Point(112, 172),
new System.Drawing.Point(70, 154)});
imageAreaPolygon1.TabIndex = 2;
imageAreaPolygon1.ToolTip = "A polygon area";
imageAreaRectangle2.Action = AreaClickAction.None;
imageAreaRectangle2.Rectangle = new System.Drawing.Rectangle(316, 176, 206, 118);
imageAreaRectangle2.ToolTip = "A tool tip only area";
imageAreaEllipse1.AccessKey = "E";
imageAreaEllipse1.Ellipse = new System.Drawing.Rectangle(199, 88, 128, 58);
imageAreaEllipse1.TabIndex = 4;
imageAreaEllipse1.ToolTip = "An ellipse area";
imMap.Areas.AddRange(new IImageArea[] {
imageAreaRectangle1,
imageAreaCircle1,
imageAreaPolygon1,
imageAreaRectangle2
imageAreaEllipse1 });
imMap.Anchor = ((System.Windows.Forms.AnchorStyles)
((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
imMap.Image = ((System.Drawing.Image)(resources.GetObject("imMap.Image")));
imMap.Location = new System.Drawing.Point(8, 8);
imMap.Name = "imMap";
imMap.Size = new System.Drawing.Size(552, 448);
imMap.TabIndex = 0;
imMap.ToolTip = "A test image";
// Add a click event handler
imMap.Click += imMap_Click;
// A simple image area click handler
private void imMap_Click(object sender, ImageMapClickEventArgs e)
{
MessageBox.Show(String.Format(
"You clicked area #{0} ({1}) at point {2}, {3}",
e.AreaIndex + 1, imMap.Areas[e.AreaIndex].ToolTip,
e.XCoordinate, e.YCoordinate), "Image Map Clicked",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Imports EWSoftware.ImageMaps
Imports EWSoftware.ImageMaps.Windows.Forms
' Example code that creates an image map and adds some image areas
Dim WithEvents imMap As ImageMap = New ImageMap()
Dim ImageAreaRectangle1 As ImageAreaRectangle = New ImageAreaRectangle()
Dim ImageAreaCircle1 As ImageAreaCircle = New ImageAreaCircle()
Dim ImageAreaPolygon1 As ImageAreaPolygon = New ImageAreaPolygon()
Dim ImageAreaRectangle2 As ImageAreaRectangle = New ImageAreaRectangle()
Dim ImageAreaEllipse1 As New ImageAreaEllipse()
ImageAreaRectangle1.AccessKey = "R"
ImageAreaRectangle1.Rectangle = New System.Drawing.Rectangle(16, 16, 150, 94)
ImageAreaRectangle1.TabIndex = 3
ImageAreaRectangle1.ToolTip = "A rectangle area"
ImageAreaCircle1.AccessKey = "C"
ImageAreaCircle1.CenterPoint = New System.Drawing.Point(380, 88)
ImageAreaCircle1.Radius = 60
ImageAreaCircle1.TabIndex = 1
ImageAreaCircle1.ToolTip = "A circle area"
ImageAreaPolygon1.AccessKey = "P"
ImageAreaPolygon1.Points.AddRange( New System.Drawing.Point() {
New System.Drawing.Point(42, 186),
New System.Drawing.Point(110, 286),
New System.Drawing.Point(144, 250),
New System.Drawing.Point(138, 230),
New System.Drawing.Point(160, 216),
New System.Drawing.Point(190, 214),
New System.Drawing.Point(152, 168),
New System.Drawing.Point(112, 172),
New System.Drawing.Point(70, 154)})
ImageAreaPolygon1.TabIndex = 2
ImageAreaPolygon1.ToolTip = "A polygon area"
ImageAreaRectangle2.Action = EWSoftware.ImageMaps.Windows.Forms.AreaClickAction.None
ImageAreaRectangle2.Rectangle = New System.Drawing.Rectangle(316, 176, 206, 118)
ImageAreaRectangle2.ToolTip = "A tool tip only area"
ImageAreaEllipse1.AccessKey = "E"
ImageAreaEllipse1.Ellipse = new System.Drawing.Rectangle(199, 88, 128, 58)
ImageAreaEllipse1.TabIndex = 4
ImageAreaEllipse1.ToolTip = "An ellipse area"
imMap.Areas.AddRange(New EWSoftware.ImageMaps.IImageArea() {
ImageAreaRectangle1,
ImageAreaCircle1,
ImageAreaPolygon1,
ImageAreaRectangle2
ImageAreaEllipse1 })
imMap.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top _
Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), _
System.Windows.Forms.AnchorStyles)
imMap.Image = CType(resources.GetObject("imMap.Image"), System.Drawing.Image)
imMap.Location = New System.Drawing.Point(8, 8)
imMap.Name = "imMap"
imMap.Size = New System.Drawing.Size(552, 448)
imMap.TabIndex = 0
imMap.ToolTip = "A test image"
' A simple image area click event handler
Private Sub imMap_Click(ByVal sender As Object, _
ByVal e As ImageMapClickEventArgs) Handles imMap.Click
MessageBox.Show(String.Format( _
"You clicked area #{0} ({1}) at point {2}, {3}", _
e.AreaIndex + 1, imMap.Areas(e.AreaIndex).ToolTip, _
e.XCoordinate, e.YCoordinate), "Image Map Clicked", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ImageAreaRectangle | Default constructor |
ImageAreaRectangle(Rectangle) | Constructor. This version takes the rectangle coordinates. |
ImageAreaRectangle(Rectangle, String) | Constructor. This version takes the rectangle coordinates and a tool tip. |
AccessKey |
This is used to get or set the access key (a shortcut key or mnemonic) for the image area
(Inherited from ImageAreaBase) |
Action |
This defines the action to take when the area is clicked
(Inherited from ImageAreaBase) |
Coordinates |
This is overridden to get or set the coordinate values in string form
(Overrides ImageAreaBaseCoordinates) |
Enabled |
This is used to enable or disable the area
(Inherited from ImageAreaBase) |
OwnerDraw |
This is used to turn owner draw mode on and off
(Inherited from ImageAreaBase) |
Rectangle | This is used to get or set the rectangle's area |
Shape |
This is overridden to provide the shape type
(Overrides ImageAreaBaseShape) |
TabIndex |
This is used to get or set the tab index of the area
(Inherited from ImageAreaBase) |
Tag |
This is used to get or set an object that contains additional user-defined data for the image area
(Inherited from ImageAreaBase) |
ToolTip |
This is used to get or set the tool tip to display when the mouse hovers over the area
(Inherited from ImageAreaBase) |
DrawFocusFrame |
This is overridden to get the shape to draw a focus frame around itself
(Overrides ImageAreaBaseDrawFocusFrame(Graphics, Point)) |
Equals |
This is overridden to allow proper comparison of image area objects.
(Inherited from ImageAreaBase) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetHashCode |
Get a hash code for the image area object
(Inherited from ImageAreaBase) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
OnClick |
This raises the image area Click event
(Inherited from ImageAreaBase) |
OnDoubleClick |
This raises the image area DoubleClick event
(Inherited from ImageAreaBase) |
OnDrawImage |
This raises the image area DrawImage event
(Inherited from ImageAreaBase) |
OnEnter |
This raises the image area Enter event
(Inherited from ImageAreaBase) |
OnImageAreaChanged |
This raises the ImageAreaChanged event
(Inherited from ImageAreaBase) |
OnLeave |
This raises the image area Leave event
(Inherited from ImageAreaBase) |
OnMouseDown |
This raises the image area MouseDown event
(Inherited from ImageAreaBase) |
OnMouseEnter |
This raises the image area MouseEnter event
(Inherited from ImageAreaBase) |
OnMouseHover |
This raises the image area MouseHover event
(Inherited from ImageAreaBase) |
OnMouseLeave |
This raises the image area MouseLeave event
(Inherited from ImageAreaBase) |
OnMouseMove |
This raises the image area MouseMove event
(Inherited from ImageAreaBase) |
OnMouseUp |
This raises the image area MouseUp event
(Inherited from ImageAreaBase) |
RaiseEvent |
This is used to fire an event on the image area
(Inherited from ImageAreaBase) |
ToString |
Convert the image area instance to its string description
(Inherited from ImageAreaBase) |
Click |
This event is raised when the image area is clicked
(Inherited from ImageAreaBase) |
DoubleClick |
This event is raised when the image area is double-clicked
(Inherited from ImageAreaBase) |
DrawImage |
This event is raised when owner draw mode is enabled and the image area needs to be drawn
(Inherited from ImageAreaBase) |
Enter |
This event is raised when the image area gains the focus
(Inherited from ImageAreaBase) |
ImageAreaChanged |
This event is raised when an image area property changes that affects its visual presentation in the
image map control such as its position or enabled state.
(Inherited from ImageAreaBase) |
Leave |
This event is raised when the image area loses the focus
(Inherited from ImageAreaBase) |
MouseDown |
This event is raised when a mouse button is pressed while the mouse is inside the image area
(Inherited from ImageAreaBase) |
MouseEnter |
This event is raised when the mouse enters the image area
(Inherited from ImageAreaBase) |
MouseHover |
This event is raised when the mouse remains stationary inside the image area for an amount of time
(Inherited from ImageAreaBase) |
MouseLeave |
This event is raised when the mouse leaves the image area
(Inherited from ImageAreaBase) |
MouseMove |
This event is raised when the mouse moves in the image area
(Inherited from ImageAreaBase) |
MouseUp |
This event is raised when a mouse button is released while the mouse is inside the image area
(Inherited from ImageAreaBase) |