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 Text2 As System.Windows.Forms.TextBox
	Public WithEvents ImageKit1 As AxIMAGEKIT7Lib.AxImageKit
	Public WithEvents Text1 As System.Windows.Forms.TextBox
	Public WithEvents _Option2_5 As System.Windows.Forms.RadioButton
	Public WithEvents _Option2_4 As System.Windows.Forms.RadioButton
	Public WithEvents _Option2_3 As System.Windows.Forms.RadioButton
	Public WithEvents _Option2_2 As System.Windows.Forms.RadioButton
	Public WithEvents _Option2_1 As System.Windows.Forms.RadioButton
	Public WithEvents _Option2_0 As System.Windows.Forms.RadioButton
	Public WithEvents Check2 As System.Windows.Forms.CheckBox
	Public WithEvents Check1 As System.Windows.Forms.CheckBox
	Public WithEvents Command4 As System.Windows.Forms.Button
	Public WithEvents Command2 As System.Windows.Forms.Button
	Public WithEvents _Option1_0 As System.Windows.Forms.RadioButton
	Public WithEvents _Option1_1 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 Label1 As System.Windows.Forms.Label
	Public WithEvents Option1 As Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray
	Public WithEvents Option2 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.Text2 = New System.Windows.Forms.TextBox
        Me.ImageKit1 = New AxIMAGEKIT7Lib.AxImageKit
        Me.Text1 = New System.Windows.Forms.TextBox
        Me._Option2_5 = New System.Windows.Forms.RadioButton
        Me._Option2_4 = New System.Windows.Forms.RadioButton
        Me._Option2_3 = New System.Windows.Forms.RadioButton
        Me._Option2_2 = New System.Windows.Forms.RadioButton
        Me._Option2_1 = New System.Windows.Forms.RadioButton
        Me._Option2_0 = New System.Windows.Forms.RadioButton
        Me.Check2 = New System.Windows.Forms.CheckBox
        Me.Check1 = New System.Windows.Forms.CheckBox
        Me.Command4 = New System.Windows.Forms.Button
        Me.Command2 = New System.Windows.Forms.Button
        Me.Frame1 = New System.Windows.Forms.GroupBox
        Me._Option1_0 = New System.Windows.Forms.RadioButton
        Me._Option1_1 = New System.Windows.Forms.RadioButton
        Me.Command3 = New System.Windows.Forms.Button
        Me.Command1 = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.Option1 = New Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray(Me.components)
        Me.Option2 = New Microsoft.VisualBasic.Compatibility.VB6.RadioButtonArray(Me.components)
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Frame1.SuspendLayout()
        CType(Me.Option1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.Option2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Text2
        '
        Me.Text2.AcceptsReturn = True
        Me.Text2.AutoSize = False
        Me.Text2.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.Text2.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.Text2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Text2.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
        Me.Text2.Location = New System.Drawing.Point(8, 0)
        Me.Text2.MaxLength = 0
        Me.Text2.Multiline = True
        Me.Text2.Name = "Text2"
        Me.Text2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text2.Size = New System.Drawing.Size(545, 64)
        Me.Text2.TabIndex = 18
        Me.Text2.Text = "This sample allows you to convert an image to 32, 24, 16, 8, 4, or 1 bit color. T" & _
        "he displayed image can be saved in bmp format which supports all of these differ" & _
        "ent bitcounts. Note that not all bitcounts are supported by every image format. " & _
        "Before saving an image, it must be converting to a bitcount support by that imag" & _
        "e format."
        '
        'ImageKit1
        '
        Me.ImageKit1.Location = New System.Drawing.Point(8, 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(433, 329)
        Me.ImageKit1.TabIndex = 17
        '
        'Text1
        '
        Me.Text1.AcceptsReturn = True
        Me.Text1.AutoSize = False
        Me.Text1.BackColor = System.Drawing.SystemColors.Window
        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.SystemColors.WindowText
        Me.Text1.Location = New System.Drawing.Point(272, 472)
        Me.Text1.MaxLength = 0
        Me.Text1.Name = "Text1"
        Me.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text1.Size = New System.Drawing.Size(49, 18)
        Me.Text1.TabIndex = 15
        Me.Text1.Text = "128"
        '
        '_Option2_5
        '
        Me._Option2_5.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_5.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_5.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_5, CType(5, Short))
        Me._Option2_5.Location = New System.Drawing.Point(336, 448)
        Me._Option2_5.Name = "_Option2_5"
        Me._Option2_5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_5.Size = New System.Drawing.Size(81, 17)
        Me._Option2_5.TabIndex = 14
        Me._Option2_5.TabStop = True
        Me._Option2_5.Text = "32 bit color"
        '
        '_Option2_4
        '
        Me._Option2_4.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_4.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_4.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_4, CType(4, Short))
        Me._Option2_4.Location = New System.Drawing.Point(248, 448)
        Me._Option2_4.Name = "_Option2_4"
        Me._Option2_4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_4.Size = New System.Drawing.Size(81, 17)
        Me._Option2_4.TabIndex = 13
        Me._Option2_4.TabStop = True
        Me._Option2_4.Text = "24 bit color"
        '
        '_Option2_3
        '
        Me._Option2_3.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_3.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_3.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_3, CType(3, Short))
        Me._Option2_3.Location = New System.Drawing.Point(168, 448)
        Me._Option2_3.Name = "_Option2_3"
        Me._Option2_3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_3.Size = New System.Drawing.Size(81, 17)
        Me._Option2_3.TabIndex = 12
        Me._Option2_3.TabStop = True
        Me._Option2_3.Text = "16 bit color"
        '
        '_Option2_2
        '
        Me._Option2_2.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_2.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_2, CType(2, Short))
        Me._Option2_2.Location = New System.Drawing.Point(336, 416)
        Me._Option2_2.Name = "_Option2_2"
        Me._Option2_2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_2.Size = New System.Drawing.Size(81, 17)
        Me._Option2_2.TabIndex = 11
        Me._Option2_2.TabStop = True
        Me._Option2_2.Text = "8 bit color"
        '
        '_Option2_1
        '
        Me._Option2_1.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_1.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_1, CType(1, Short))
        Me._Option2_1.Location = New System.Drawing.Point(248, 416)
        Me._Option2_1.Name = "_Option2_1"
        Me._Option2_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_1.Size = New System.Drawing.Size(81, 17)
        Me._Option2_1.TabIndex = 10
        Me._Option2_1.TabStop = True
        Me._Option2_1.Text = "4 bit color"
        '
        '_Option2_0
        '
        Me._Option2_0.BackColor = System.Drawing.SystemColors.Control
        Me._Option2_0.Cursor = System.Windows.Forms.Cursors.Default
        Me._Option2_0.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._Option2_0.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Option2.SetIndex(Me._Option2_0, CType(0, Short))
        Me._Option2_0.Location = New System.Drawing.Point(168, 416)
        Me._Option2_0.Name = "_Option2_0"
        Me._Option2_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option2_0.Size = New System.Drawing.Size(81, 17)
        Me._Option2_0.TabIndex = 9
        Me._Option2_0.TabStop = True
        Me._Option2_0.Text = "1 bit color"
        '
        'Check2
        '
        Me.Check2.BackColor = System.Drawing.SystemColors.Control
        Me.Check2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Check2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Check2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Check2.Location = New System.Drawing.Point(16, 440)
        Me.Check2.Name = "Check2"
        Me.Check2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Check2.Size = New System.Drawing.Size(113, 17)
        Me.Check2.TabIndex = 8
        Me.Check2.Text = "Dither"
        '
        'Check1
        '
        Me.Check1.BackColor = System.Drawing.SystemColors.Control
        Me.Check1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Check1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Check1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Check1.Location = New System.Drawing.Point(16, 408)
        Me.Check1.Name = "Check1"
        Me.Check1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Check1.Size = New System.Drawing.Size(89, 25)
        Me.Check1.TabIndex = 7
        Me.Check1.Text = "Fixed Palette"
        '
        '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(456, 416)
        Me.Command4.Name = "Command4"
        Me.Command4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command4.Size = New System.Drawing.Size(89, 33)
        Me.Command4.TabIndex = 6
        Me.Command4.Text = "Execute"
        '
        '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(456, 120)
        Me.Command2.Name = "Command2"
        Me.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command2.Size = New System.Drawing.Size(97, 33)
        Me.Command2.TabIndex = 5
        Me.Command2.Text = "Save As Bmp"
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.Add(Me._Option1_0)
        Me.Frame1.Controls.Add(Me._Option1_1)
        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(456, 240)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(97, 73)
        Me.Frame1.TabIndex = 2
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Display Mode"
        '
        '_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(8, 24)
        Me._Option1_0.Name = "_Option1_0"
        Me._Option1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_0.Size = New System.Drawing.Size(81, 12)
        Me._Option1_0.TabIndex = 4
        Me._Option1_0.TabStop = True
        Me._Option1_0.Text = "Scale"
        '
        '_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, 48)
        Me._Option1_1.Name = "_Option1_1"
        Me._Option1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Option1_1.Size = New System.Drawing.Size(81, 12)
        Me._Option1_1.TabIndex = 3
        Me._Option1_1.TabStop = True
        Me._Option1_1.Text = "Actual Size"
        '
        '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(456, 176)
        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 = "End"
        '
        '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(456, 72)
        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"
        '
        '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(24, 472)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(240, 16)
        Me.Label1.TabIndex = 16
        Me.Label1.Text = "Threshold (0 to 255) when converting 1 bit color"
        '
        'Option1
        '
        '
        'Option2
        '
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.Control
        Me.ClientSize = New System.Drawing.Size(560, 494)
        Me.Controls.Add(Me.Text2)
        Me.Controls.Add(Me.ImageKit1)
        Me.Controls.Add(Me.Text1)
        Me.Controls.Add(Me._Option2_5)
        Me.Controls.Add(Me._Option2_4)
        Me.Controls.Add(Me._Option2_3)
        Me.Controls.Add(Me._Option2_2)
        Me.Controls.Add(Me._Option2_1)
        Me.Controls.Add(Me._Option2_0)
        Me.Controls.Add(Me.Check2)
        Me.Controls.Add(Me.Check1)
        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.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 = "More About Converting Bitcounts"
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Frame1.ResumeLayout(False)
        CType(Me.Option1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.Option2, 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 ret As Boolean
	Dim FixPal As Boolean
	Dim Diz As Boolean
	Dim Pixel As Short
	Dim ShowMode As IMAGEKIT7Lib.DispModeConstants
	
	'UPGRADE_WARNING: Event Check1.CheckStateChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2075"'
	Private Sub Check1_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Check1.CheckStateChanged
		If Check1.CheckState = 0 Then
			FixPal = False
		Else
			FixPal = True
		End If
	End Sub
	
	'UPGRADE_WARNING: Event Check2.CheckStateChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2075"'
	Private Sub Check2_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Check2.CheckStateChanged
		If Check2.CheckState = 0 Then
			Diz = False
		Else
			Diz = True
		End If
	End Sub
	
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		If ImageKit1.File.OpenFileDialog = False Then
			Exit Sub
		End If
		
		ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad)
		
		If ImageKit1.ImageKind <> IMAGEKIT7Lib.ImageKindConstants.ikRasterImage Then
			ImageKit1.FreeMemory(ImageKit1.ImageHandle)
		End If
		
		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
		'save the image as a bmp image...
        ImageKit1.File.FileName = Application.StartupPath & "\test.bmp"
		ret = ImageKit1.File.SaveFile(IMAGEKIT7Lib.SaveFileConstants.ikSaveBMP, 0)
		
		If ret <> False Then
			MsgBox("Image saved in the following directory:" & vbCrLf & ImageKit1.File.FileName)
		Else
			MsgBox("Unable to save image")
		End If
	End Sub
	
	Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
		Me.Close()
	End Sub
	
	Private Sub Command4_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command4.Click
		If ImageKit1.ImageHandle = 0 Then
			Exit Sub
		End If
		
		Form2.DefInstance.Show()
		ret = ImageKit1.Effect.ConvertColor(Pixel, FixPal, Diz, Val(Text1.Text))
		Form2.DefInstance.Close()
		
		ImageKit1.CtlRefresh()
	End Sub
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		ImageKit1.ScrollBar = True
		
		ShowMode = IMAGEKIT7Lib.DispModeConstants.ikScale
		Option1(0).Checked = True
		
		FixPal = False
		Diz = False
		Pixel = 1
		
		Check1.CheckState = System.Windows.Forms.CheckState.Unchecked
		Check2.CheckState = System.Windows.Forms.CheckState.Unchecked
		Option2(0).Checked = True
	End Sub
	
	Private Sub IkEffect1_Progress(ByVal Percent As Short)
		Form2.DefInstance.Label1.Text = CStr(Percent)
		Form2.DefInstance.Label1.Refresh()
		System.Windows.Forms.Application.DoEvents()
	End Sub
	
	Private Sub IkFile1_Progress(ByVal Percent As Short)
	End Sub
	
	Private Sub ImageKit1_Progress(ByVal eventSender As System.Object, ByVal eventArgs As AxIMAGEKIT7Lib._IImageKitEvents_ProgressEvent) Handles ImageKit1.Progress
		Form2.DefInstance.Label1.Text = CStr(eventArgs.Percent)
		Form2.DefInstance.Label1.Refresh()
		System.Windows.Forms.Application.DoEvents()
	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)
			If Index = 0 Then
				ShowMode = IMAGEKIT7Lib.DispModeConstants.ikScale
			Else
				ShowMode = IMAGEKIT7Lib.DispModeConstants.ikActualSize
			End If
			
			ImageKit1.Display(ShowMode)
		End If
	End Sub
	
	'UPGRADE_WARNING: Event Option2.CheckedChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2075"'
	Private Sub Option2_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Option2.CheckedChanged
		If eventSender.Checked Then
			Dim Index As Short = Option2.GetIndex(eventSender)
			If Index = 0 Then Pixel = 1
			If Index = 1 Then Pixel = 4
			If Index = 2 Then Pixel = 8
			If Index = 3 Then Pixel = 16
			If Index = 4 Then Pixel = 24
			If Index = 5 Then Pixel = 32
		End If
	End Sub

    Private Sub Text2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Text2.TextChanged

    End Sub

End Class