ToolTipText = "Finishes the drawind of the polygon"
Top = 1065
Width = 975
End
Begin VB.OptionButton optFreeHand
Caption = "Polygon"
Height = 285
Left = 1440
Style = 1 'Graphical
TabIndex = 7
ToolTipText = "Cretes an area blocked by the polygon"
Top = 720
Width = 975
End
Begin VB.OptionButton optCircle
Caption = "Circle"
Height = 285
Left = 1440
Style = 1 'Graphical
TabIndex = 6
ToolTipText = "Creates an area blocked by a circular shape"
Top = 360
Width = 975
End
Begin VB.OptionButton optRect
Caption = "Rectangle"
Height = 285
Left = 240
Style = 1 'Graphical
TabIndex = 4
TabStop = 0 'False
ToolTipText = "Creates an area blocked by a rectangular shape"
Top = 720
Width = 975
End
Begin VB.OptionButton optMove
Caption = "Pan (move)"
Height = 285
Left = 240
Style = 1 'Graphical
TabIndex = 3
ToolTipText = "If you have a big image Pan it to see all of it."
Top = 360
Value = -1 'True
Width = 975
End
End
Begin VB.PictureBox picOrg
Height = 375
Left = 4470
ScaleHeight = 21
ScaleMode = 3 'Pixel
ScaleWidth = 61
TabIndex = 1
Top = 15
Visible = 0 'False
Width = 975
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
DrawMode = 6 'Mask Pen Not
DrawWidth = 2
ForeColor = &H00FF00FF&
Height = 3735
Left = 120
ScaleHeight = 245
ScaleMode = 3 'Pixel
ScaleWidth = 269
TabIndex = 0
Top = 240
Width = 4095
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackColor = &H8000000C&
BorderStyle = 1 'Fixed Single
Caption = "Exit"
Height = 240
Left = 0
TabIndex = 17
Top = -15
Width = 375
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Type POintXY
X As Integer
Y As Integer
End Type
Private Type MObjct
oType As String
oCoord() As POintXY
oRadius As Integer
oDeleted As Boolean
oLink As String
End Type
Dim FileName, ApPath As String
Dim CurrentObject
Dim XDrag, YDrag, OldY, OldX
Dim Dragging, RectDrag, CircleDrag, FreeHandDrag As Boolean
Dim MapObject() As MObjct
Dim FreeHandIndex As Integer
Private Sub cmdDeleteAllObjects_Click()
Dim I
For I = 0 To UBound(MapObject)
If MapObject(I).oDeleted = True Then GoTo DelOK
Next
Exit Sub
DelOK:
If MsgBox("Delete all mapping objects?", vbYesNo + vbQuestion, "Delete All Mapping Objects") Then
For I = 0 To UBound(MapObject)
MapObject(I).oDeleted = True
Next
DrawPic 0, 0
DrawAllObjects
RefreshList
End If
End Sub
Private Sub cmdDeleteObj_Click()
Dim I, C
If lstObjects.ListIndex <> -1 Then
For I = 0 To UBound(MapObject)
If MapObject(I).oDeleted = False Then C = C + 1
If C = lstObjects.ListIndex + 1 Then MapObject(I).oDeleted = True
Next
lstObjects.RemoveItem lstObjects.ListIndex
DrawPic 0, 0
DrawAllObjects
Else: MsgBox "No obejcts selected or no objects exist.", vbExclamation
S = "Right-Click ->View Source.. Copy and paste into your own page<BR>Note that only the ares that you've chosen in the Image Mapper link to their destantion and not the whole rectangular image as usual. (dah, this is the whole purpose of the programme)<BR>" & vbNewLine & "<MAP name=myMap>"
For I = 0 To UBound(MapObject)
If MapObject(I).oDeleted = False Then
Select Case MapObject(I).oType
Case "circle"
S = S & vbNewLine & " <AREA shape=""circle"" COORDS="""
S = S & Str(MapObject(I).oCoord(0).X) & "," & Str(MapObject(I).oCoord(0).Y) & "," & Str(MapObject(I).oRadius)
Case "rect"
S = S & vbNewLine & " <AREA shape=""rect"" COORDS="""
S = S & Str(MapObject(I).oCoord(0).X) & "," & Str(MapObject(I).oCoord(0).Y) & "," & Str(MapObject(I).oCoord(1).X) & "," & Str(MapObject(I).oCoord(1).Y) & """"
Case "poly"
S = S & vbNewLine & " <AREA shape=""poly"" COORDS="""
For k = 0 To UBound(MapObject(I).oCoord)
S = S & Str(MapObject(I).oCoord(k).X) & "," & Str(MapObject(I).oCoord(k).Y)
If k <> UBound(MapObject(I).oCoord) Then S = S & ","
Next
End Select
If MapObject(I).oType <> "" Then
S = S & """ href=""" & MapObject(I).oLink & """>"
Else: S = "<MAP name=myMap>"
End If
End If
Next
S = S & vbNewLine & "</MAP>"
S = S & vbNewLine & vbNewLine & "<IMG src=""" & FileName & """ USEMAP=""#myMap"">"