public abstract class ImageAreaBase : IImageArea
Public MustInherit Class ImageAreaBase
Implements IImageArea
public ref class ImageAreaBase abstract : IImageArea
[<AbstractClassAttribute>]
type ImageAreaBase =
class
interface IImageArea
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.
ImageAreaBase | Default constructor |
ImageAreaBase(String) | This version of the constructor takes a tool tip |
AccessKey | This is used to get or set the access key (a shortcut key or mnemonic) for the image area |
Action | This defines the action to take when the area is clicked |
Coordinates | This must be overridden to provide the image area coordinates |
Enabled | This is used to enable or disable the area |
OwnerDraw | This is used to turn owner draw mode on and off |
Shape | This must be overridden to provide the image area shape |
TabIndex | This is used to get or set the tab index of the area |
Tag | This is used to get or set an object that contains additional user-defined data for the image area |
ToolTip | This is used to get or set the tool tip to display when the mouse hovers over the area |
DrawFocusFrame | This must be overridden to get the shape to draw a focus frame around itself |
Equals |
This is overridden to allow proper comparison of image area objects.
(Overrides ObjectEquals(Object)) |
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
(Overrides ObjectGetHashCode) |
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 |
OnDoubleClick | This raises the image area DoubleClick event |
OnDrawImage | This raises the image area DrawImage event |
OnEnter | This raises the image area Enter event |
OnImageAreaChanged | This raises the ImageAreaChanged event |
OnLeave | This raises the image area Leave event |
OnMouseDown | This raises the image area MouseDown event |
OnMouseEnter | This raises the image area MouseEnter event |
OnMouseHover | This raises the image area MouseHover event |
OnMouseLeave | This raises the image area MouseLeave event |
OnMouseMove | This raises the image area MouseMove event |
OnMouseUp | This raises the image area MouseUp event |
RaiseEvent | This is used to fire an event on the image area |
ToString |
Convert the image area instance to its string description
(Overrides ObjectToString) |
Click | This event is raised when the image area is clicked |
DoubleClick | This event is raised when the image area is double-clicked |
DrawImage | This event is raised when owner draw mode is enabled and the image area needs to be drawn |
Enter | This event is raised when the image area gains the focus |
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. |
Leave | This event is raised when the image area loses the focus |
MouseDown | This event is raised when a mouse button is pressed while the mouse is inside the image area |
MouseEnter | This event is raised when the mouse enters the image area |
MouseHover | This event is raised when the mouse remains stationary inside the image area for an amount of time |
MouseLeave | This event is raised when the mouse leaves the image area |
MouseMove | This event is raised when the mouse moves in the image area |
MouseUp | This event is raised when a mouse button is released while the mouse is inside the image area |