Option Strict Off
Option Explicit On
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'For the start-up form, the first instance created is the default instance.
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'This call is required by the Windows Form Designer.
		InitializeComponent()
	End Sub
	'Form overrides dispose to clean up the component list.
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Required by the Windows Form Designer
	Private components As System.ComponentModel.IContainer
    Public WithEvents Text1 As System.Windows.Forms.TextBox
	Public WithEvents ImageKit1 As AxIMAGEKIT7Lib.AxImageKit
	Public WithEvents Command4 As System.Windows.Forms.Button
	Public WithEvents Command2 As System.Windows.Forms.Button
	Public WithEvents _Option1_3 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_2 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_1 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_0 As System.Windows.Forms.RadioButton
	Public WithEvents Frame1 As System.Windows.Forms.GroupBox
	Public WithEvents Command3 As System.Windows.Forms.Button
	Public WithEvents Command1 As System.Windows.Forms.Button
	Public WithEvents ImageKit2 As AxIMAGEKIT7Lib.AxImageKit
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	Public WithEvents Option1 As Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray
	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.
	'Do not modify it using the code editor.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Text1 = New System.Windows.Forms.TextBox
        Me.ImageKit1 = New AxIMAGEKIT7Lib.AxImageKit
        Me.Command4 = New System.Windows.Forms.Button
        Me.Command2 = New System.Windows.Forms.Button
        Me.Frame1 = New System.Windows.Forms.GroupBox
        Me._Option1_3 = New System.Windows.Forms.RadioButton
        Me._Option1_2 = New System.Windows.Forms.RadioButton
        Me._Option1_1 = New System.Windows.Forms.RadioButton
        Me._Option1_0 = New System.Windows.Forms.RadioButton
        Me.Command3 = New System.Windows.Forms.Button
        Me.Command1 = New System.Windows.Forms.Button
        Me.ImageKit2 = New AxIMAGEKIT7Lib.AxImageKit
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.Option1 = New Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray(Me.components)
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Frame1.SuspendLayout()
        CType(Me.ImageKit2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.Option1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Text1
        '
        Me.Text1.AcceptsReturn = True
        Me.Text1.AutoSize = False
        Me.Text1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.Text1.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.Text1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Text1.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
        Me.Text1.Location = New System.Drawing.Point(8, 0)
        Me.Text1.MaxLength = 0
        Me.Text1.Multiline = True
        Me.Text1.Name = "Text1"
        Me.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text1.Size = New System.Drawing.Size(673, 40)
        Me.Text1.TabIndex = 13
        Me.Text1.Text = "The SelectImage method can copy the entire image, an area on the image defined by" & _
        " a polygon, or an elliptical area. This sample illustrates these ways to select " & _
        "portions of an image and copy them with the SelectImage method."
        '
        'ImageKit1
        '
        Me.ImageKit1.Location = New System.Drawing.Point(24, 72)
        Me.ImageKit1.Name = "ImageKit1"
        Me.ImageKit1.OcxState = CType(resources.GetObject("ImageKit1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ImageKit1.Size = New System.Drawing.Size(305, 225)
        Me.ImageKit1.TabIndex = 10
        '
        'Command4
        '
        Me.Command4.BackColor = System.Drawing.SystemColors.Control
        Me.Command4.Cursor = System.Windows.Forms.Cursors.Default
        Me.Command4.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Command4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Command4.Location = New System.Drawing.Point(576, 352)
        Me.Command4.Name = "Command4"
        Me.Command4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command4.Size = New System.Drawing.Size(97, 33)
        Me.Command4.TabIndex = 5
        Me.Command4.Text = "End"
        '
        'Command2
        '
        Me.Command2.BackColor = System.Drawing.SystemColors.Control
        Me.Command2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Command2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Command2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Command2.Location = New System.Drawing.Point(272, 312)
        Me.Command2.Name = "Command2"
        Me.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command2.Size = New System.Drawing.Size(97, 33)
        Me.Command2.TabIndex = 4
        Me.Command2.Text = "Cut Selection"
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.Add(Me._Option1_3)
        Me.Frame1.Controls.Add(Me._Option1_2)
        Me.Frame1.Controls.Add(Me._Option1_1)
        Me.Frame1.Controls.Add(Me._Option1_0)
        Me.Frame1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(144, 304)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(113, 89)
        Me.Frame1.TabIndex = 2
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "SelectMode"
        '
        '_Option1_3
        '
        Me._Option1_3.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_3.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_3.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_3, CType(3, Short))
        Me._Option1_3.Location = New System.Drawing.Point(8, 64)
        Me._Option1_3.Name = "_Option1_3"
        Me._Option1_3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_3.Size = New System.Drawing.Size(81, 17)
        Me._Option1_3.TabIndex = 12
        Me._Option1_3.TabStop = True
        Me._Option1_3.Text = "Rectangle"
        '
        '_Option1_2
        '
        Me._Option1_2.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_2.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_2, CType(2, Short))
        Me._Option1_2.Location = New System.Drawing.Point(8, 48)
        Me._Option1_2.Name = "_Option1_2"
        Me._Option1_2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_2.Size = New System.Drawing.Size(65, 17)
        Me._Option1_2.TabIndex = 9
        Me._Option1_2.TabStop = True
        Me._Option1_2.Text = "Ellipse"
        '
        '_Option1_1
        '
        Me._Option1_1.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_1.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_1, CType(1, Short))
        Me._Option1_1.Location = New System.Drawing.Point(8, 32)
        Me._Option1_1.Name = "_Option1_1"
        Me._Option1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_1.Size = New System.Drawing.Size(65, 17)
        Me._Option1_1.TabIndex = 8
        Me._Option1_1.TabStop = True
        Me._Option1_1.Text = "Polygon"
        '
        '_Option1_0
        '
        Me._Option1_0.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_0.Checked = True
        Me._Option1_0.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_0.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_0.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_0, CType(0, Short))
        Me._Option1_0.Location = New System.Drawing.Point(8, 16)
        Me._Option1_0.Name = "_Option1_0"
        Me._Option1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_0.Size = New System.Drawing.Size(97, 17)
        Me._Option1_0.TabIndex = 3
        Me._Option1_0.TabStop = True
        Me._Option1_0.Text = "Total Image"
        '
        'Command3
        '
        Me.Command3.BackColor = System.Drawing.SystemColors.Control
        Me.Command3.Cursor = System.Windows.Forms.Cursors.Default
        Me.Command3.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Command3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Command3.Location = New System.Drawing.Point(272, 352)
        Me.Command3.Name = "Command3"
        Me.Command3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command3.Size = New System.Drawing.Size(97, 33)
        Me.Command3.TabIndex = 1
        Me.Command3.Text = "Clear Selection"
        '
        'Command1
        '
        Me.Command1.BackColor = System.Drawing.SystemColors.Control
        Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Command1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Command1.Location = New System.Drawing.Point(24, 312)
        Me.Command1.Name = "Command1"
        Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command1.Size = New System.Drawing.Size(97, 33)
        Me.Command1.TabIndex = 0
        Me.Command1.Text = "Load Image"
        '
        'ImageKit2
        '
        Me.ImageKit2.Location = New System.Drawing.Point(360, 72)
        Me.ImageKit2.Name = "ImageKit2"
        Me.ImageKit2.OcxState = CType(resources.GetObject("ImageKit2.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ImageKit2.Size = New System.Drawing.Size(305, 225)
        Me.ImageKit2.TabIndex = 11
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(480, 48)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(105, 17)
        Me.Label2.TabIndex = 7
        Me.Label2.Text = "Processed Image"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label1.Location = New System.Drawing.Point(136, 48)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(81, 17)
        Me.Label1.TabIndex = 6
        Me.Label1.Text = "Original Image"
        '
        'Option1
        '
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.Control
        Me.ClientSize = New System.Drawing.Size(686, 406)
        Me.Controls.Add(Me.Text1)
        Me.Controls.Add(Me.ImageKit1)
        Me.Controls.Add(Me.Command4)
        Me.Controls.Add(Me.Command2)
        Me.Controls.Add(Me.Frame1)
        Me.Controls.Add(Me.Command3)
        Me.Controls.Add(Me.Command1)
        Me.Controls.Add(Me.ImageKit2)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Cursor = System.Windows.Forms.Cursors.Default
        Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Location = New System.Drawing.Point(3, 22)
        Me.Name = "Form1"
        Me.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Selecting areas"
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Frame1.ResumeLayout(False)
        CType(Me.ImageKit2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.Option1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "Upgrade Support "
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	Dim Ix(32) As Integer
	Dim Iy(32) As Integer
	Dim Points As Integer
	Dim SMode As IMAGEKIT7Lib.AreaSelectModeConstants
	Dim efx As Boolean
	Dim rectangle As Boolean
	
	
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		efx = False 'this keeps the ImageKit process event from firing when an image is loaded
		
		'display the Open file dialog
		If ImageKit1.File.OpenFileDialog = False Then
			Exit Sub
		End If
		
		' load the image
		ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad)
		
		'check to see if it is a raster image or not
		If ImageKit1.ImageKind <> IMAGEKIT7Lib.ImageKindConstants.ikRasterImage Then
			ImageKit1.FreeMemory(ImageKit1.ImageHandle)
		End If
		
		' display the image
		ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale)
	End Sub
	
	Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
		Dim ret As Boolean
		
		efx = True
		
		'exit if no image is loaded in the ImageKit1 Control
		If ImageKit1.ImageHandle = 0 Then
			Exit Sub
		End If
		
		
		' copy the original image in ImageKit1.ImageHandle into the ImageKit2.ImageHandle
		ImageKit2.ImageHandle = ImageKit1.CopyImage(ImageKit1.ImageHandle)
		
		' process the area selected by mouse
		Form2.DefInstance.Show()
		ImageKit2.Effect.InOut = IMAGEKIT7Lib.InOutSelectModeConstants.ikInside
		ImageKit2.Effect.SelectMode = SMode
		
		'if the rectangle option is selected then set the coordinates of the mouse drag rectangle
		'into the coordinate arrays
		If rectangle = True Then
			Ix(0) = ImageKit1.RectLeft
			Iy(0) = ImageKit1.RectTop
			Ix(1) = ImageKit1.RectRight
			Iy(1) = ImageKit1.RectTop
			Ix(2) = ImageKit1.RectRight
			Iy(2) = ImageKit1.RectBottom
			Ix(3) = ImageKit1.RectLeft
			Iy(3) = ImageKit1.RectBottom
			Points = 4
		Else
			ImageKit2.Effect.RectLeft = ImageKit1.RectLeft
			ImageKit2.Effect.RectTop = ImageKit1.RectTop
			ImageKit2.Effect.RectRight = ImageKit1.RectRight
			ImageKit2.Effect.RectBottom = ImageKit1.RectBottom
		End If
		
		'select that portion of the image defined by the coordinate points
		'(when SMode = ikEffectPolygon) or defined by the RectLeft,RectTop,
		'RectRight,and RectBottom property values (when SMode = ikEffectElipse)
		ret = ImageKit2.Effect.SelectImage(Ix(0), Iy(0), Points, 255, 255, 255)
		Form2.DefInstance.Close()
		If ret = False Then
			ImageKit2.Display(IMAGEKIT7Lib.DispModeConstants.ikClear)
			Exit Sub
		End If
		
		Points = 0
		
		ImageKit2.Display(IMAGEKIT7Lib.DispModeConstants.ikScale)
	End Sub
	
	Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
		'clear the ImageKit2 control
		Points = 0
		ImageKit1.RectLeft = 0
		ImageKit1.RectTop = 0
		ImageKit1.RectRight = 0
		ImageKit1.RectBottom = 0
		ImageKit1.RectDraw = False
		ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale)
		SMode = 1
		Option1(0).Checked = True
		
		If ImageKit2.ImageHandle <> 0 Then
			ImageKit2.FreeMemory(ImageKit2.ImageHandle)
			ImageKit2.ImageHandle = 0
		End If
		ImageKit2.Display(IMAGEKIT7Lib.DispModeConstants.ikScale)
	End Sub
	
	Private Sub Command4_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command4.Click
		Me.Close()
	End Sub
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		Points = 0
		SMode = 1
		ImageKit1.RectDraw = False
	End Sub
	
	Private Sub ImageKit1_MouseDownEvent(ByVal eventSender As System.Object, ByVal eventArgs As AxIMAGEKIT7Lib._IImageKitEvents_MouseDownEvent) Handles ImageKit1.MouseDownEvent
		Dim ret As Boolean
		
		If rectangle = False Then
			'draw little circles where the mouse is clicked....
			If ImageKit1.ImageHandle <> 0 And SMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectPolygon Then
				ImageKit1.PrintDraw.ClearProperty()
				ImageKit1.PrintDraw.PenMode = IMAGEKIT7Lib.PenModeConstants.ikPenModeNotXorPen
				ImageKit1.PrintDraw.PenWidth = 2
				ImageKit1.PrintDraw.PenStyle = IMAGEKIT7Lib.PenStyleConstants.ikPenSolid
				ret = ImageKit1.PrintDraw.Ellipse(ImageKit1.hDC, eventArgs.x - 2, eventArgs.y - 2, eventArgs.x + 2, eventArgs.y + 2, IMAGEKIT7Lib.OutPutDeviceModeConstants.ikScreen)
			End If
		End If
	End Sub
	
	Private Sub ImageKit2_Progress(ByVal eventSender As System.Object, ByVal eventArgs As AxIMAGEKIT7Lib._IImageKitEvents_ProgressEvent) Handles ImageKit2.Progress
		If efx = True Then
			Form2.DefInstance.Label1.Text = CStr(eventArgs.Percent)
			Form2.DefInstance.Label1.Refresh()
			System.Windows.Forms.Application.DoEvents()
		End If
		
	End Sub

	Private Sub Option1_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Option1.CheckedChanged
		If eventSender.Checked Then
			Dim Index As Short = Option1.GetIndex(eventSender)
			ImageKit1.RectLeft = 0
			ImageKit1.RectTop = 0
			ImageKit1.RectRight = 0
			ImageKit1.RectBottom = 0
			Points = 0
			ImageKit1.RectDraw = False
			
			Select Case Index
				Case 0
					SMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectAll
					ImageKit1.RectDraw = False
					rectangle = False
				Case 1
					SMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectPolygon
					ImageKit1.RectDraw = False
					rectangle = False
				Case 2
					SMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectEllipse
					ImageKit1.RectDraw = True
					rectangle = False
				Case 3
					SMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectPolygon
					ImageKit1.RectDraw = True
					rectangle = True
			End Select
		End If
	End Sub

    Private Sub ImageKit1_MouseDownImage(ByVal sender As Object, ByVal e As AxIMAGEKIT7Lib._IImageKitEvents_MouseDownImageEvent) Handles ImageKit1.MouseDownImage
        Select Case SMode
            Case IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectPolygon
                Ix(Points) = e.x
                Iy(Points) = e.y
                Points = Points + 1
        End Select
    End Sub
End Class