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 _Option1_8 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_7 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_6 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_5 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_4 As System.Windows.Forms.RadioButton
	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 Command1 As System.Windows.Forms.Button
	Public WithEvents Command2 As System.Windows.Forms.Button
	Public WithEvents ImageKit1 As AxIMAGEKIT7Lib.AxImageKit
	Public WithEvents Text1 As System.Windows.Forms.TextBox
	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._Option1_8 = New System.Windows.Forms.RadioButton
        Me._Option1_7 = New System.Windows.Forms.RadioButton
        Me._Option1_6 = New System.Windows.Forms.RadioButton
        Me._Option1_5 = New System.Windows.Forms.RadioButton
        Me._Option1_4 = New System.Windows.Forms.RadioButton
        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.Frame1 = New System.Windows.Forms.GroupBox
        Me.Command1 = New System.Windows.Forms.Button
        Me.Command2 = New System.Windows.Forms.Button
        Me.ImageKit1 = New AxIMAGEKIT7Lib.AxImageKit
        Me.Text1 = New System.Windows.Forms.TextBox
        Me.Option1 = New Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray(Me.components)
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.Option1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        '_Option1_8
        '
        Me._Option1_8.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_8.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_8.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_8.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_8, CType(8, Short))
        Me._Option1_8.Location = New System.Drawing.Point(432, 200)
        Me._Option1_8.Name = "_Option1_8"
        Me._Option1_8.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_8.Size = New System.Drawing.Size(97, 17)
        Me._Option1_8.TabIndex = 13
        Me._Option1_8.TabStop = True
        Me._Option1_8.Text = "All Image Files"
        '
        '_Option1_7
        '
        Me._Option1_7.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_7.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_7.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_7.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_7, CType(7, Short))
        Me._Option1_7.Location = New System.Drawing.Point(432, 184)
        Me._Option1_7.Name = "_Option1_7"
        Me._Option1_7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_7.Size = New System.Drawing.Size(81, 17)
        Me._Option1_7.TabIndex = 12
        Me._Option1_7.TabStop = True
        Me._Option1_7.Text = "JPEG 2000"
        '
        '_Option1_6
        '
        Me._Option1_6.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_6.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_6.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_6, CType(6, Short))
        Me._Option1_6.Location = New System.Drawing.Point(432, 168)
        Me._Option1_6.Name = "_Option1_6"
        Me._Option1_6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_6.Size = New System.Drawing.Size(81, 17)
        Me._Option1_6.TabIndex = 11
        Me._Option1_6.TabStop = True
        Me._Option1_6.Text = "WMF"
        '
        '_Option1_5
        '
        Me._Option1_5.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_5.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_5.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_5, CType(5, Short))
        Me._Option1_5.Location = New System.Drawing.Point(432, 152)
        Me._Option1_5.Name = "_Option1_5"
        Me._Option1_5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_5.Size = New System.Drawing.Size(81, 17)
        Me._Option1_5.TabIndex = 10
        Me._Option1_5.TabStop = True
        Me._Option1_5.Text = "EMF"
        '
        '_Option1_4
        '
        Me._Option1_4.BackColor = System.Drawing.SystemColors.Control
        Me._Option1_4.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option1_4.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option1_4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option1.SetIndex(Me._Option1_4, CType(4, Short))
        Me._Option1_4.Location = New System.Drawing.Point(432, 136)
        Me._Option1_4.Name = "_Option1_4"
        Me._Option1_4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_4.Size = New System.Drawing.Size(81, 17)
        Me._Option1_4.TabIndex = 9
        Me._Option1_4.TabStop = True
        Me._Option1_4.Text = "TIFF "
        '
        '_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(432, 120)
        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 = 8
        Me._Option1_3.TabStop = True
        Me._Option1_3.Text = "PNG"
        '
        '_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(432, 104)
        Me._Option1_2.Name = "_Option1_2"
        Me._Option1_2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_2.Size = New System.Drawing.Size(81, 17)
        Me._Option1_2.TabIndex = 7
        Me._Option1_2.TabStop = True
        Me._Option1_2.Text = "JPEG"
        '
        '_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(432, 88)
        Me._Option1_1.Name = "_Option1_1"
        Me._Option1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_1.Size = New System.Drawing.Size(81, 17)
        Me._Option1_1.TabIndex = 6
        Me._Option1_1.TabStop = True
        Me._Option1_1.Text = "GIF"
        '
        '_Option1_0
        '
        Me._Option1_0.BackColor = System.Drawing.SystemColors.Control
        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(432, 72)
        Me._Option1_0.Name = "_Option1_0"
        Me._Option1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_0.Size = New System.Drawing.Size(73, 17)
        Me._Option1_0.TabIndex = 5
        Me._Option1_0.TabStop = True
        Me._Option1_0.Text = "BMP"
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        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(424, 56)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(121, 169)
        Me.Frame1.TabIndex = 4
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Some Image Types"
        '
        '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(424, 272)
        Me.Command1.Name = "Command1"
        Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command1.Size = New System.Drawing.Size(121, 33)
        Me.Command1.TabIndex = 3
        Me.Command1.Text = "Load and Display"
        '
        '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(424, 352)
        Me.Command2.Name = "Command2"
        Me.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command2.Size = New System.Drawing.Size(121, 33)
        Me.Command2.TabIndex = 2
        Me.Command2.Text = "End"
        '
        'ImageKit1
        '
        Me.ImageKit1.Location = New System.Drawing.Point(8, 56)
        Me.ImageKit1.Name = "ImageKit1"
        Me.ImageKit1.OcxState = CType(resources.GetObject("ImageKit1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ImageKit1.Size = New System.Drawing.Size(409, 345)
        Me.ImageKit1.TabIndex = 1
        '
        '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.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        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(64, 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(537, 49)
        Me.Text1.TabIndex = 0
        Me.Text1.Text = "The ImageKit supports a variety of image formats. When loading an image, the Load" & _
        "File method can automatically recognize and load all supported image formats or " & _
        "you can set the method parameters to load only the image format of your choice."
        '
        'Option1
        '
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.Control
        Me.ClientSize = New System.Drawing.Size(550, 407)
        Me.Controls.Add(Me._Option1_8)
        Me.Controls.Add(Me._Option1_7)
        Me.Controls.Add(Me._Option1_6)
        Me.Controls.Add(Me._Option1_5)
        Me.Controls.Add(Me._Option1_4)
        Me.Controls.Add(Me._Option1_3)
        Me.Controls.Add(Me._Option1_2)
        Me.Controls.Add(Me._Option1_1)
        Me.Controls.Add(Me._Option1_0)
        Me.Controls.Add(Me.Frame1)
        Me.Controls.Add(Me.Command1)
        Me.Controls.Add(Me.Command2)
        Me.Controls.Add(Me.ImageKit1)
        Me.Controls.Add(Me.Text1)
        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(248, 270)
        Me.Name = "Form1"
        Me.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "Loading Only Certain Image Types"
        CType(Me.ImageKit1, 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 IntIndex As Short
	Dim ImageType As Short
	
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		Dim ret As Boolean
		Dim ErrorMessage As String
		
		'reset ret variable
		ret = True
		
		'display the Open file dialog
		'and choose the image to be loaded...
		If ImageKit1.File.OpenFileDialog = False Then
			Exit Sub
		End If
		
		Select Case IntIndex
			Case 0
				ImageType = 1 'ikLoadBMP
				ErrorMessage = "Please load a BMP image"
			Case 1
				ImageType = 3 'ikLoadGIF
				ErrorMessage = "Please load a GIF image"
			Case 2
				ImageType = 2 'ikLoadJPEG
				ErrorMessage = "Please load a JPEG image"
			Case 3
				ImageType = 5 'ikLoadPNG
				ErrorMessage = "Please load a PNG image"
			Case 4
				ImageType = 4 'ikLoadTIFF
				ErrorMessage = "Please load an Uncompressed TIFF image"
			Case 5
				ImageType = 9 'ikLoadEMF
				ErrorMessage = "Please load a EMF image"
			Case 6
				ImageType = 8 'ikLoadWMF
				ErrorMessage = "Please load a WMF image"
			Case 7
				ImageType = 12 'ikLoadJPEG2000
				ErrorMessage = "Please load a JPEG2000 image"
			Case 8
				ImageType = 0 'ikLoad
				ErrorMessage = "Unable to load image. Is that a supported image format?"
		End Select
		
		
		
		'load the image file...
		ret = ImageKit1.File.LoadFile(ImageType)
		
		If ret = False Then
			MsgBox(ErrorMessage)
			Exit Sub
		End If
		
		'display image in scale mode
		ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale)
	End Sub
	
	Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
		Me.Close()
	End Sub
	
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		'set the option button
		Option1(8).Checked = True
	End Sub
	
	'UPGRADE_WARNING: Event Option1.CheckedChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2075"'
	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)
			IntIndex = Index
		End If
	End Sub


End Class