using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Project1
{
	/// <summary>
	/// 
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		public System.Windows.Forms.Button Command4;
		public System.Windows.Forms.GroupBox Frame8;
		public System.Windows.Forms.CheckBox Check8;
		public System.Windows.Forms.Button Command1;
		public System.Windows.Forms.GroupBox Frame6;
		public System.Windows.Forms.CheckBox Check4;
		public System.Windows.Forms.CheckBox Check3;
		public System.Windows.Forms.GroupBox Frame9;
		public System.Windows.Forms.Button Command2;
		public System.Windows.Forms.GroupBox Frame5;
		public System.Windows.Forms.CheckBox Check2;
		public System.Windows.Forms.CheckBox Check1;
		public System.Windows.Forms.GroupBox Frame2;
		public System.Windows.Forms.TextBox Text1;
		public System.Windows.Forms.CheckBox Check7;
		public System.Windows.Forms.GroupBox Frame7;
		public System.Windows.Forms.CheckBox Check5;
		public System.Windows.Forms.CheckBox Check6;
		public System.Windows.Forms.Label Label2;
		public System.Windows.Forms.GroupBox Frame1;
		public System.Windows.Forms.HScrollBar HScroll1;
		public System.Windows.Forms.Label Label1;
		public System.Windows.Forms.GroupBox Frame3;
		/// <summary>
		///
		/// </summary>
		private System.ComponentModel.Container components = null;
		public System.Windows.Forms.CheckBox Check9_0;
		public System.Windows.Forms.CheckBox Check9_1;
		public System.Windows.Forms.CheckBox Check9_2;

		public System.Windows.Forms.RadioButton Option2_2;
		public System.Windows.Forms.RadioButton Option2_1;
		public System.Windows.Forms.RadioButton Option2_0;
		public System.Windows.Forms.RadioButton Option1_0;
		public System.Windows.Forms.RadioButton Option1_2;
		public System.Windows.Forms.CheckBox Check9_4;
		public System.Windows.Forms.CheckBox Check9_3;
		public System.Windows.Forms.RadioButton Option1_1;

		private Form2 ProgressForm;
		private short LayerImageCount;
		private IMAGEKIT7Lib.UnitConstants Coordinate;
		private System.Windows.Forms.CheckBox Check10;
		public System.Windows.Forms.RadioButton Option1_3;
		public System.Windows.Forms.RadioButton Option1_4;
		private AxIMAGEKIT7Lib.AxImageKit ImageKit1;
		private System.Windows.Forms.Label label3;
		private IMAGEKIT7Lib.DispModeConstants ShowMode;

		public Form1()
		{
			//
			// 
			//
			InitializeComponent();

	
		}

		/// <summary>
		///
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.Command4 = new System.Windows.Forms.Button();
			this.Frame8 = new System.Windows.Forms.GroupBox();
			this.Check8 = new System.Windows.Forms.CheckBox();
			this.Command1 = new System.Windows.Forms.Button();
			this.Frame6 = new System.Windows.Forms.GroupBox();
			this.Check4 = new System.Windows.Forms.CheckBox();
			this.Check3 = new System.Windows.Forms.CheckBox();
			this.Frame9 = new System.Windows.Forms.GroupBox();
			this.Check9_4 = new System.Windows.Forms.CheckBox();
			this.Check9_3 = new System.Windows.Forms.CheckBox();
			this.Command2 = new System.Windows.Forms.Button();
			this.Check9_0 = new System.Windows.Forms.CheckBox();
			this.Check9_1 = new System.Windows.Forms.CheckBox();
			this.Check9_2 = new System.Windows.Forms.CheckBox();
			this.Frame5 = new System.Windows.Forms.GroupBox();
			this.Check2 = new System.Windows.Forms.CheckBox();
			this.Check1 = new System.Windows.Forms.CheckBox();
			this.Frame2 = new System.Windows.Forms.GroupBox();
			this.Text1 = new System.Windows.Forms.TextBox();
			this.Check7 = new System.Windows.Forms.CheckBox();
			this.Frame7 = new System.Windows.Forms.GroupBox();
			this.Option2_2 = new System.Windows.Forms.RadioButton();
			this.Option2_1 = new System.Windows.Forms.RadioButton();
			this.Option2_0 = new System.Windows.Forms.RadioButton();
			this.Check5 = new System.Windows.Forms.CheckBox();
			this.Check6 = new System.Windows.Forms.CheckBox();
			this.Label2 = new System.Windows.Forms.Label();
			this.Frame1 = new System.Windows.Forms.GroupBox();
			this.HScroll1 = new System.Windows.Forms.HScrollBar();
			this.Label1 = new System.Windows.Forms.Label();
			this.Frame3 = new System.Windows.Forms.GroupBox();
			this.Option1_4 = new System.Windows.Forms.RadioButton();
			this.Option1_3 = new System.Windows.Forms.RadioButton();
			this.Option1_0 = new System.Windows.Forms.RadioButton();
			this.Option1_2 = new System.Windows.Forms.RadioButton();
			this.Option1_1 = new System.Windows.Forms.RadioButton();
			this.Check10 = new System.Windows.Forms.CheckBox();
			this.ImageKit1 = new AxIMAGEKIT7Lib.AxImageKit();
			this.label3 = new System.Windows.Forms.Label();
			this.Frame8.SuspendLayout();
			this.Frame6.SuspendLayout();
			this.Frame9.SuspendLayout();
			this.Frame5.SuspendLayout();
			this.Frame2.SuspendLayout();
			this.Frame7.SuspendLayout();
			this.Frame1.SuspendLayout();
			this.Frame3.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.ImageKit1)).BeginInit();
			this.SuspendLayout();
			// 
			// Command4
			// 
			this.Command4.BackColor = System.Drawing.SystemColors.Control;
			this.Command4.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command4.Location = new System.Drawing.Point(492, 585);
			this.Command4.Name = "Command4";
			this.Command4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command4.Size = new System.Drawing.Size(105, 53);
			this.Command4.TabIndex = 50;
			this.Command4.Text = "End";
			this.Command4.Click += new System.EventHandler(this.Command4_Click);
			// 
			// Frame8
			// 
			this.Frame8.BackColor = System.Drawing.SystemColors.Control;
			this.Frame8.Controls.Add(this.Check8);
			this.Frame8.Controls.Add(this.Command1);
			this.Frame8.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame8.Location = new System.Drawing.Point(492, 56);
			this.Frame8.Name = "Frame8";
			this.Frame8.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame8.Size = new System.Drawing.Size(105, 79);
			this.Frame8.TabIndex = 48;
			this.Frame8.TabStop = false;
			this.Frame8.Text = "Base Image";
			// 
			// Check8
			// 
			this.Check8.BackColor = System.Drawing.SystemColors.Control;
			this.Check8.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check8.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check8.Location = new System.Drawing.Point(16, 17);
			this.Check8.Name = "Check8";
			this.Check8.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check8.Size = new System.Drawing.Size(73, 19);
			this.Check8.TabIndex = 33;
			this.Check8.Text = "Display";
			this.Check8.Click += new System.EventHandler(this.Check8_Click);
			// 
			// Command1
			// 
			this.Command1.BackColor = System.Drawing.SystemColors.Control;
			this.Command1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command1.Location = new System.Drawing.Point(8, 43);
			this.Command1.Name = "Command1";
			this.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command1.Size = new System.Drawing.Size(89, 27);
			this.Command1.TabIndex = 15;
			this.Command1.Text = "Load";
			this.Command1.Click += new System.EventHandler(this.Command1_Click);
			// 
			// Frame6
			// 
			this.Frame6.BackColor = System.Drawing.SystemColors.Control;
			this.Frame6.Controls.Add(this.Check4);
			this.Frame6.Controls.Add(this.Check3);
			this.Frame6.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame6.Location = new System.Drawing.Point(340, 568);
			this.Frame6.Name = "Frame6";
			this.Frame6.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame6.Size = new System.Drawing.Size(124, 70);
			this.Frame6.TabIndex = 45;
			this.Frame6.TabStop = false;
			this.Frame6.Text = "Pan Window";
			// 
			// Check4
			// 
			this.Check4.BackColor = System.Drawing.SystemColors.Control;
			this.Check4.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check4.Location = new System.Drawing.Point(16, 43);
			this.Check4.Name = "Check4";
			this.Check4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check4.Size = new System.Drawing.Size(96, 19);
			this.Check4.TabIndex = 26;
			this.Check4.Text = "Close button";
			this.Check4.Click += new System.EventHandler(this.Check4_Click);
			// 
			// Check3
			// 
			this.Check3.BackColor = System.Drawing.SystemColors.Control;
			this.Check3.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check3.Location = new System.Drawing.Point(16, 17);
			this.Check3.Name = "Check3";
			this.Check3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check3.Size = new System.Drawing.Size(88, 19);
			this.Check3.TabIndex = 23;
			this.Check3.Text = "Display";
			this.Check3.Click += new System.EventHandler(this.Check3_Click);
			// 
			// Frame9
			// 
			this.Frame9.BackColor = System.Drawing.SystemColors.Control;
			this.Frame9.Controls.Add(this.label3);
			this.Frame9.Controls.Add(this.Check9_4);
			this.Frame9.Controls.Add(this.Check9_3);
			this.Frame9.Controls.Add(this.Command2);
			this.Frame9.Controls.Add(this.Check9_0);
			this.Frame9.Controls.Add(this.Check9_1);
			this.Frame9.Controls.Add(this.Check9_2);
			this.Frame9.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame9.Location = new System.Drawing.Point(492, 186);
			this.Frame9.Name = "Frame9";
			this.Frame9.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame9.Size = new System.Drawing.Size(120, 190);
			this.Frame9.TabIndex = 52;
			this.Frame9.TabStop = false;
			this.Frame9.Text = "Image Layers";
			// 
			// Check9_4
			// 
			this.Check9_4.BackColor = System.Drawing.SystemColors.Control;
			this.Check9_4.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check9_4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check9_4.Location = new System.Drawing.Point(16, 116);
			this.Check9_4.Name = "Check9_4";
			this.Check9_4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check9_4.Size = new System.Drawing.Size(41, 18);
			this.Check9_4.TabIndex = 34;
			this.Check9_4.Text = "5";
			this.Check9_4.Click += new System.EventHandler(this.Check9_4_Click);
			// 
			// Check9_3
			// 
			this.Check9_3.BackColor = System.Drawing.SystemColors.Control;
			this.Check9_3.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check9_3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check9_3.Location = new System.Drawing.Point(16, 92);
			this.Check9_3.Name = "Check9_3";
			this.Check9_3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check9_3.Size = new System.Drawing.Size(41, 19);
			this.Check9_3.TabIndex = 33;
			this.Check9_3.Text = "4";
			this.Check9_3.Click += new System.EventHandler(this.Check9_3_Click);
			// 
			// Command2
			// 
			this.Command2.BackColor = System.Drawing.SystemColors.Control;
			this.Command2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command2.Location = new System.Drawing.Point(8, 144);
			this.Command2.Name = "Command2";
			this.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command2.Size = new System.Drawing.Size(89, 30);
			this.Command2.TabIndex = 32;
			this.Command2.Text = "Load";
			this.Command2.Click += new System.EventHandler(this.Command2_Click);
			// 
			// Check9_0
			// 
			this.Check9_0.BackColor = System.Drawing.SystemColors.Control;
			this.Check9_0.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check9_0.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check9_0.Location = new System.Drawing.Point(16, 32);
			this.Check9_0.Name = "Check9_0";
			this.Check9_0.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check9_0.Size = new System.Drawing.Size(84, 18);
			this.Check9_0.TabIndex = 31;
			this.Check9_0.Text = "1(Red)";
			this.Check9_0.Click += new System.EventHandler(this.Check9_0_Click);
			// 
			// Check9_1
			// 
			this.Check9_1.BackColor = System.Drawing.SystemColors.Control;
			this.Check9_1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check9_1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check9_1.Location = new System.Drawing.Point(16, 52);
			this.Check9_1.Name = "Check9_1";
			this.Check9_1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check9_1.Size = new System.Drawing.Size(84, 19);
			this.Check9_1.TabIndex = 30;
			this.Check9_1.Text = "2(Green)";
			this.Check9_1.Click += new System.EventHandler(this.Check9_1_Click);
			// 
			// Check9_2
			// 
			this.Check9_2.BackColor = System.Drawing.SystemColors.Control;
			this.Check9_2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check9_2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check9_2.Location = new System.Drawing.Point(16, 72);
			this.Check9_2.Name = "Check9_2";
			this.Check9_2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check9_2.Size = new System.Drawing.Size(84, 18);
			this.Check9_2.TabIndex = 29;
			this.Check9_2.Text = "3(Blue)";
			this.Check9_2.Click += new System.EventHandler(this.Check9_2_Click);
			// 
			// Frame5
			// 
			this.Frame5.BackColor = System.Drawing.SystemColors.Control;
			this.Frame5.Controls.Add(this.Check2);
			this.Frame5.Controls.Add(this.Check1);
			this.Frame5.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame5.Location = new System.Drawing.Point(340, 468);
			this.Frame5.Name = "Frame5";
			this.Frame5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame5.Size = new System.Drawing.Size(124, 69);
			this.Frame5.TabIndex = 47;
			this.Frame5.TabStop = false;
			this.Frame5.Text = "Scroll";
			// 
			// Check2
			// 
			this.Check2.BackColor = System.Drawing.SystemColors.Control;
			this.Check2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check2.Location = new System.Drawing.Point(16, 43);
			this.Check2.Name = "Check2";
			this.Check2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check2.Size = new System.Drawing.Size(65, 19);
			this.Check2.TabIndex = 22;
			this.Check2.Text = "Drag";
			this.Check2.Click += new System.EventHandler(this.Check2_Click);
			// 
			// Check1
			// 
			this.Check1.BackColor = System.Drawing.SystemColors.Control;
			this.Check1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check1.Location = new System.Drawing.Point(16, 17);
			this.Check1.Name = "Check1";
			this.Check1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check1.Size = new System.Drawing.Size(96, 19);
			this.Check1.TabIndex = 13;
			this.Check1.Text = "Scroll Bar";
			this.Check1.Click += new System.EventHandler(this.Check1_Click);
			// 
			// Frame2
			// 
			this.Frame2.BackColor = System.Drawing.SystemColors.Control;
			this.Frame2.Controls.Add(this.Text1);
			this.Frame2.Controls.Add(this.Check7);
			this.Frame2.Controls.Add(this.Frame7);
			this.Frame2.Controls.Add(this.Check5);
			this.Frame2.Controls.Add(this.Check6);
			this.Frame2.Controls.Add(this.Label2);
			this.Frame2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame2.Location = new System.Drawing.Point(24, 533);
			this.Frame2.Name = "Frame2";
			this.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame2.Size = new System.Drawing.Size(297, 122);
			this.Frame2.TabIndex = 46;
			this.Frame2.TabStop = false;
			this.Frame2.Text = "Grid, Graduation";
			// 
			// Text1
			// 
			this.Text1.AcceptsReturn = true;
			this.Text1.AutoSize = false;
			this.Text1.BackColor = System.Drawing.SystemColors.Window;
			this.Text1.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.Text1.ForeColor = System.Drawing.SystemColors.WindowText;
			this.Text1.Location = new System.Drawing.Point(96, 91);
			this.Text1.MaxLength = 0;
			this.Text1.Name = "Text1";
			this.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Text1.Size = new System.Drawing.Size(73, 20);
			this.Text1.TabIndex = 37;
			this.Text1.Text = "10";
			this.Text1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Text1_KeyDown);
			// 
			// Check7
			// 
			this.Check7.BackColor = System.Drawing.SystemColors.Control;
			this.Check7.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check7.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check7.Location = new System.Drawing.Point(28, 65);
			this.Check7.Name = "Check7";
			this.Check7.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check7.Size = new System.Drawing.Size(128, 18);
			this.Check7.TabIndex = 27;
			this.Check7.Text = "Display Coordinate";
			this.Check7.Click += new System.EventHandler(this.Check7_Click);
			// 
			// Frame7
			// 
			this.Frame7.BackColor = System.Drawing.SystemColors.Control;
			this.Frame7.Controls.Add(this.Option2_2);
			this.Frame7.Controls.Add(this.Option2_1);
			this.Frame7.Controls.Add(this.Option2_0);
			this.Frame7.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame7.Location = new System.Drawing.Point(216, 17);
			this.Frame7.Name = "Frame7";
			this.Frame7.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame7.Size = new System.Drawing.Size(73, 97);
			this.Frame7.TabIndex = 11;
			this.Frame7.TabStop = false;
			this.Frame7.Text = "Units";
			// 
			// Option2_2
			// 
			this.Option2_2.BackColor = System.Drawing.SystemColors.Control;
			this.Option2_2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option2_2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option2_2.Location = new System.Drawing.Point(8, 69);
			this.Option2_2.Name = "Option2_2";
			this.Option2_2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option2_2.Size = new System.Drawing.Size(48, 18);
			this.Option2_2.TabIndex = 21;
			this.Option2_2.TabStop = true;
			this.Option2_2.Text = "Inch";
			this.Option2_2.Click += new System.EventHandler(this.Option2_2_Click);
			// 
			// Option2_1
			// 
			this.Option2_1.BackColor = System.Drawing.SystemColors.Control;
			this.Option2_1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option2_1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option2_1.Location = new System.Drawing.Point(8, 43);
			this.Option2_1.Name = "Option2_1";
			this.Option2_1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option2_1.Size = new System.Drawing.Size(49, 18);
			this.Option2_1.TabIndex = 20;
			this.Option2_1.TabStop = true;
			this.Option2_1.Text = "mm";
			this.Option2_1.Click += new System.EventHandler(this.Option2_1_Click);
			// 
			// Option2_0
			// 
			this.Option2_0.BackColor = System.Drawing.SystemColors.Control;
			this.Option2_0.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option2_0.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option2_0.Location = new System.Drawing.Point(8, 17);
			this.Option2_0.Name = "Option2_0";
			this.Option2_0.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option2_0.Size = new System.Drawing.Size(49, 18);
			this.Option2_0.TabIndex = 19;
			this.Option2_0.TabStop = true;
			this.Option2_0.Text = "Pixel";
			this.Option2_0.Click += new System.EventHandler(this.Option2_0_Click);
			// 
			// Check5
			// 
			this.Check5.BackColor = System.Drawing.SystemColors.Control;
			this.Check5.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check5.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check5.Location = new System.Drawing.Point(28, 22);
			this.Check5.Name = "Check5";
			this.Check5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check5.Size = new System.Drawing.Size(136, 18);
			this.Check5.TabIndex = 10;
			this.Check5.Text = "Display graduation";
			this.Check5.Click += new System.EventHandler(this.Check5_Click);
			// 
			// Check6
			// 
			this.Check6.BackColor = System.Drawing.SystemColors.Control;
			this.Check6.Cursor = System.Windows.Forms.Cursors.Default;
			this.Check6.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Check6.Location = new System.Drawing.Point(28, 43);
			this.Check6.Name = "Check6";
			this.Check6.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Check6.Size = new System.Drawing.Size(136, 19);
			this.Check6.TabIndex = 9;
			this.Check6.Text = "Display Grid";
			this.Check6.Click += new System.EventHandler(this.Check6_Click);
			// 
			// Label2
			// 
			this.Label2.BackColor = System.Drawing.SystemColors.Control;
			this.Label2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label2.Location = new System.Drawing.Point(28, 95);
			this.Label2.Name = "Label2";
			this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label2.Size = new System.Drawing.Size(73, 19);
			this.Label2.TabIndex = 39;
			this.Label2.Text = "Grid Width";
			// 
			// Frame1
			// 
			this.Frame1.BackColor = System.Drawing.SystemColors.Control;
			this.Frame1.Controls.Add(this.HScroll1);
			this.Frame1.Controls.Add(this.Label1);
			this.Frame1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame1.Location = new System.Drawing.Point(28, 464);
			this.Frame1.Name = "Frame1";
			this.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame1.Size = new System.Drawing.Size(297, 61);
			this.Frame1.TabIndex = 44;
			this.Frame1.TabStop = false;
			this.Frame1.Text = "Display Scale";
			// 
			// HScroll1
			// 
			this.HScroll1.Cursor = System.Windows.Forms.Cursors.Default;
			this.HScroll1.LargeChange = 1;
			this.HScroll1.Location = new System.Drawing.Point(72, 26);
			this.HScroll1.Maximum = 29;
			this.HScroll1.Minimum = 1;
			this.HScroll1.Name = "HScroll1";
			this.HScroll1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.HScroll1.Size = new System.Drawing.Size(201, 18);
			this.HScroll1.TabIndex = 6;
			this.HScroll1.TabStop = true;
			this.HScroll1.Value = 10;
			this.HScroll1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.HScroll1_Scroll);
			// 
			// Label1
			// 
			this.Label1.BackColor = System.Drawing.SystemColors.Control;
			this.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.Label1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label1.Location = new System.Drawing.Point(8, 26);
			this.Label1.Name = "Label1";
			this.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label1.Size = new System.Drawing.Size(49, 18);
			this.Label1.TabIndex = 38;
			this.Label1.Text = "1";
			// 
			// Frame3
			// 
			this.Frame3.BackColor = System.Drawing.SystemColors.Control;
			this.Frame3.Controls.Add(this.Option1_4);
			this.Frame3.Controls.Add(this.Option1_3);
			this.Frame3.Controls.Add(this.Option1_0);
			this.Frame3.Controls.Add(this.Option1_2);
			this.Frame3.Controls.Add(this.Option1_1);
			this.Frame3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame3.Location = new System.Drawing.Point(24, 403);
			this.Frame3.Name = "Frame3";
			this.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame3.Size = new System.Drawing.Size(415, 53);
			this.Frame3.TabIndex = 42;
			this.Frame3.TabStop = false;
			this.Frame3.Text = "Display Mode";
			// 
			// Option1_4
			// 
			this.Option1_4.BackColor = System.Drawing.SystemColors.Control;
			this.Option1_4.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option1_4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option1_4.Location = new System.Drawing.Point(320, 26);
			this.Option1_4.Name = "Option1_4";
			this.Option1_4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_4.Size = new System.Drawing.Size(88, 17);
			this.Option1_4.TabIndex = 5;
			this.Option1_4.TabStop = true;
			this.Option1_4.Text = "Fit to Height";
			this.Option1_4.Click += new System.EventHandler(this.Option1_4_Click);
			// 
			// Option1_3
			// 
			this.Option1_3.BackColor = System.Drawing.SystemColors.Control;
			this.Option1_3.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option1_3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option1_3.Location = new System.Drawing.Point(228, 26);
			this.Option1_3.Name = "Option1_3";
			this.Option1_3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_3.Size = new System.Drawing.Size(84, 17);
			this.Option1_3.TabIndex = 4;
			this.Option1_3.TabStop = true;
			this.Option1_3.Text = "Fit to Width";
			this.Option1_3.Click += new System.EventHandler(this.Option1_3_Click);
			// 
			// Option1_0
			// 
			this.Option1_0.BackColor = System.Drawing.SystemColors.Control;
			this.Option1_0.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option1_0.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option1_0.Location = new System.Drawing.Point(8, 26);
			this.Option1_0.Name = "Option1_0";
			this.Option1_0.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_0.Size = new System.Drawing.Size(64, 17);
			this.Option1_0.TabIndex = 3;
			this.Option1_0.TabStop = true;
			this.Option1_0.Text = "Scale";
			this.Option1_0.Click += new System.EventHandler(this.Option1_0_Click);
			// 
			// Option1_2
			// 
			this.Option1_2.BackColor = System.Drawing.SystemColors.Control;
			this.Option1_2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option1_2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option1_2.Location = new System.Drawing.Point(144, 26);
			this.Option1_2.Name = "Option1_2";
			this.Option1_2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_2.Size = new System.Drawing.Size(84, 17);
			this.Option1_2.TabIndex = 2;
			this.Option1_2.TabStop = true;
			this.Option1_2.Text = "Actual Size";
			this.Option1_2.Click += new System.EventHandler(this.Option1_2_Click);
			// 
			// Option1_1
			// 
			this.Option1_1.BackColor = System.Drawing.SystemColors.Control;
			this.Option1_1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Option1_1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Option1_1.Location = new System.Drawing.Point(72, 26);
			this.Option1_1.Name = "Option1_1";
			this.Option1_1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_1.Size = new System.Drawing.Size(68, 17);
			this.Option1_1.TabIndex = 1;
			this.Option1_1.TabStop = true;
			this.Option1_1.Text = "Stretch";
			this.Option1_1.Click += new System.EventHandler(this.Option1_1_Click);
			// 
			// Check10
			// 
			this.Check10.Location = new System.Drawing.Point(488, 490);
			this.Check10.Name = "Check10";
			this.Check10.Size = new System.Drawing.Size(120, 26);
			this.Check10.TabIndex = 54;
			this.Check10.Text = "Magnifying Glass";
			// 
			// ImageKit1
			// 
			this.ImageKit1.Location = new System.Drawing.Point(32, 22);
			this.ImageKit1.Name = "ImageKit1";
			this.ImageKit1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("ImageKit1.OcxState")));
			this.ImageKit1.Size = new System.Drawing.Size(444, 364);
			this.ImageKit1.TabIndex = 55;
			this.ImageKit1.MouseMoveImage += new AxIMAGEKIT7Lib._IImageKitEvents_MouseMoveImageEventHandler(this.ImageKit1_MouseMoveImage_1);
			this.ImageKit1.GetDragDropFileName += new AxIMAGEKIT7Lib._IImageKitEvents_GetDragDropFileNameEventHandler(this.ImageKit1_GetDragDropFileName_1);
			this.ImageKit1.Progress += new AxIMAGEKIT7Lib._IImageKitEvents_ProgressEventHandler(this.ImageKit1_Progress);
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(12, 16);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(104, 16);
			this.label3.TabIndex = 35;
			this.label3.Text = "(Transparent Color)";
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(618, 667);
			this.Controls.Add(this.ImageKit1);
			this.Controls.Add(this.Check10);
			this.Controls.Add(this.Command4);
			this.Controls.Add(this.Frame8);
			this.Controls.Add(this.Frame6);
			this.Controls.Add(this.Frame9);
			this.Controls.Add(this.Frame5);
			this.Controls.Add(this.Frame2);
			this.Controls.Add(this.Frame1);
			this.Controls.Add(this.Frame3);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "General Display Features";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.Closed += new System.EventHandler(this.Form1_Closed);
			this.Frame8.ResumeLayout(false);
			this.Frame6.ResumeLayout(false);
			this.Frame9.ResumeLayout(false);
			this.Frame5.ResumeLayout(false);
			this.Frame2.ResumeLayout(false);
			this.Frame7.ResumeLayout(false);
			this.Frame1.ResumeLayout(false);
			this.Frame3.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.ImageKit1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
			Check9_0.Enabled = false;
			Check9_1.Enabled = false;
			Check9_2.Enabled = false;
			Check9_3.Enabled = false;
			Check9_4.Enabled = false;
		
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikScale; 
			Option1_0.Checked = true;
			Option1_1.Checked = false;
			Option1_2.Checked = false;
			Option1_3.Checked = false;
			Option1_4.Checked = false;
		
			Coordinate = IMAGEKIT7Lib.UnitConstants.ikPixel; 
			Option2_0.Checked = true;
			Option2_1.Checked = false;
			Option2_2.Checked = false;
		
			LayerImageCount = 0; 

			ProgressForm = new Form2();
		}

		//load the base image
		private void Command1_Click(object sender, System.EventArgs e)
		{
			if (ImageKit1.File.OpenFileDialog() == false) 
				return;
		
			// set the image number of the base image
			ImageKit1.LayerNo = -1;

			ProgressForm.CancelFlag = false;
			ProgressForm.Show();
			ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad); 
			ProgressForm.Hide();

			ImageKit1.Display(ShowMode);

			Check8.Enabled = true;
			Check8.Checked = true;	
		}

		//base image display or not
		private void Check8_Click(object sender, System.EventArgs e)
		{
			ImageKit1.ShowInDisp = Check8.Checked;
			ImageKit1.ShowInPanWindow = Check8.Checked;
		}


		//load layer image
		private void Command2_Click(object sender, System.EventArgs e)
		{
			if (ImageKit1.File.OpenFileDialog() == false) 
				return;

			// set the current image's layer number
			ImageKit1.LayerNo = LayerImageCount;
        
			ImageKit1.get_Layer(LayerImageCount).Transparent = false;
			ImageKit1.get_Layer(LayerImageCount).TransRed = 0;
			ImageKit1.get_Layer(LayerImageCount).TransGreen = 0;
			ImageKit1.get_Layer(LayerImageCount).TransBlue = 0;

			// set red to be transparent
			if (LayerImageCount == 0)
			{
				ImageKit1.get_Layer(LayerImageCount).Transparent = true;
				ImageKit1.get_Layer(LayerImageCount).TransRed = 255;
				ImageKit1.get_Layer(LayerImageCount).TransGreen = 0;
				ImageKit1.get_Layer(LayerImageCount).TransBlue = 0;
			}
			// set green to be transparent
			if (LayerImageCount == 1)
			{
				ImageKit1.get_Layer(LayerImageCount).Transparent = true;
				ImageKit1.get_Layer(LayerImageCount).TransRed = 0;
				ImageKit1.get_Layer(LayerImageCount).TransGreen = 255;
				ImageKit1.get_Layer(LayerImageCount).TransBlue = 0;
			}
			// set blue to be transparent
			if (LayerImageCount == 2)
			{
				ImageKit1.get_Layer(LayerImageCount).Transparent = true;
				ImageKit1.get_Layer(LayerImageCount).TransRed = 0;
				ImageKit1.get_Layer(LayerImageCount).TransGreen = 0;
				ImageKit1.get_Layer(LayerImageCount).TransBlue = 255;
			}


			ProgressForm.CancelFlag = false;
			ProgressForm.Show();
			ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad);
			ProgressForm.Hide();

			ImageKit1.Display(ShowMode);

			switch (LayerImageCount) 
			{
				case 0:
					Check9_0.Enabled = true;
					Check9_0.Checked = true;
					break;
				case 1:
					Check9_1.Enabled = true;
					Check9_1.Checked = true;
					break;
				case 2:
					Check9_2.Enabled = true;
					Check9_2.Checked = true;
					break;
				case 3:
					Check9_3.Enabled = true;
					Check9_3.Checked = true;
					break;
				case 4:
					Check9_4.Enabled = true;
					Check9_4.Checked = true;
					break;
			}

			LayerImageCount++;
			if (LayerImageCount > 4)
				LayerImageCount = 0;
		}

		//layer1 image display or not
		private void Check9_0_Click(object sender, System.EventArgs e)
		{
			ImageKit1.get_Layer(0).ShowInDisp = Check9_0.Checked;
			ImageKit1.get_Layer(0).ShowInPanWindow = Check9_0.Checked;
		}

		//layer2 image display or not
		private void Check9_1_Click(object sender, System.EventArgs e)
		{
			ImageKit1.get_Layer(1).ShowInDisp = Check9_1.Checked;
			ImageKit1.get_Layer(1).ShowInPanWindow = Check9_1.Checked;
		}

		//layer3 image display or not
		private void Check9_2_Click(object sender, System.EventArgs e)
		{
			ImageKit1.get_Layer(2).ShowInDisp = Check9_2.Checked;
			ImageKit1.get_Layer(2).ShowInPanWindow = Check9_2.Checked;
		}

		//layer4 image display or not
		private void Check9_3_Click(object sender, System.EventArgs e)
		{
			ImageKit1.get_Layer(3).ShowInDisp = Check9_3.Checked;
			ImageKit1.get_Layer(3).ShowInPanWindow = Check9_3.Checked;
		}

		//layer5 image display or not
		private void Check9_4_Click(object sender, System.EventArgs e)
		{
			ImageKit1.get_Layer(4).ShowInDisp = Check9_4.Checked;
			ImageKit1.get_Layer(4).ShowInPanWindow = Check9_4.Checked;
		}

		//scale
		private void Option1_0_Click(object sender, System.EventArgs e)
		{
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikScale;
			ImageKit1.Display(ShowMode);
		}

		//stretch
		private void Option1_1_Click(object sender, System.EventArgs e)
		{
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikStretch;
			ImageKit1.Display(ShowMode);		
		}

		//actual size
		private void Option1_2_Click(object sender, System.EventArgs e)
		{
			ImageKit1.DispScaleX = Convert.ToDouble(Label1.Text);
			ImageKit1.DispScaleY = Convert.ToDouble(Label1.Text);
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikActualSize;
			ImageKit1.Display(ShowMode);
		}

		//fit to width
		private void Option1_3_Click(object sender, System.EventArgs e)
		{
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikFitToWidth;
			ImageKit1.Display(ShowMode);
		}

		//fit to height
		private void Option1_4_Click(object sender, System.EventArgs e)
		{
			ShowMode = IMAGEKIT7Lib.DispModeConstants.ikFitToHeight;
			ImageKit1.Display(ShowMode);
		}

		//scrollbars
		private void Check1_Click(object sender, System.EventArgs e)
		{
			if (Check1.Checked == true)
				ImageKit1.ScrollBar = true;
			else
				ImageKit1.ScrollBar = false;
		}

		//drag on/off
		private void Check2_Click(object sender, System.EventArgs e)
		{
			if (Check2.Checked == true)
				ImageKit1.MouseDragImage = true;
			else
				ImageKit1.MouseDragImage = false;
		}

		//pan window
		private void Check3_Click(object sender, System.EventArgs e)
		{
			ImageKit1.PanWindow.Show(Check3.Checked);
		}

		//close button of pan window
		private void Check4_Click(object sender, System.EventArgs e)
		{
			ImageKit1.PanWindow.CloseBox = Check4.Checked;		
		}

		//graduation
		private void Show_Grad()
		{
			if (Check5.Checked == true)
				ImageKit1.Grad = Coordinate;
			else
				ImageKit1.Grad = IMAGEKIT7Lib.UnitConstants.ikNone;
		}

		private void Check5_Click(object sender, System.EventArgs e)
		{
			Show_Grad();
		}

		//grid
		private void Show_Grid()
		{
			if (Check6.Checked == true)
			{
				ImageKit1.GridSpace = Convert.ToDouble(Text1.Text);
				ImageKit1.Grid = Coordinate;
			} 
			else
				ImageKit1.Grid = IMAGEKIT7Lib.UnitConstants.ikNone;
		}	

		private void Check6_Click(object sender, System.EventArgs e)
		{
			Show_Grid();
		}

		//coordinates
		private void Show_ToolTip()
		{
			if (Check7.Checked == true)
				ImageKit1.ToolTip = Coordinate;
			else
				ImageKit1.ToolTip = IMAGEKIT7Lib.UnitConstants.ikNone;
		}	

		private void Check7_Click(object sender, System.EventArgs e)
		{
			Show_ToolTip();
		}

		private void Form1_Closed(object sender, System.EventArgs e)
		{
			ProgressForm.Close();
		}

		//unit of graduation, grid, coordinates - pixel
		private void Option2_0_Click(object sender, System.EventArgs e)
		{
			Coordinate = IMAGEKIT7Lib.UnitConstants.ikPixel;
			Show_Grad();
			Show_Grid();
			Show_ToolTip();
		}

		//unit of graduation, grid, coordinates - mm
		private void Option2_1_Click(object sender, System.EventArgs e)
		{
			Coordinate = IMAGEKIT7Lib.UnitConstants.ikmm;
			Show_Grad();
			Show_Grid();
			Show_ToolTip();
		}

		//unit of graduation, grid, coordinates - inch
		private void Option2_2_Click(object sender, System.EventArgs e)
		{
			Coordinate = IMAGEKIT7Lib.UnitConstants.ikInch;		
			Show_Grad();
			Show_Grid();
			Show_ToolTip();
		}

		//scaling
		private void HScroll1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
		{
			switch (e.Type)
			{
				case ScrollEventType.EndScroll:
					ScaleChange(e.NewValue);
					break;
			}
		}

		private void ScaleChange(int newScrollValue)
		{
			double dScale;

			Option1_2.Checked = true;

			if (newScrollValue <= 10)
				dScale = newScrollValue / 10.0;
			else
				dScale = newScrollValue - 10 + 1;

			Label1.Text = dScale.ToString();
			ImageKit1.DispScaleX = dScale;
			ImageKit1.DispScaleY = dScale;
			ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikActualSize);
		}

		//exit
		private void Command4_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void Text1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				ImageKit1.GridSpace = Convert.ToDouble(Text1.Text);
				ImageKit1.Display(ShowMode);
			}
	
		}

		//drag & drop
		private void ImageKit1_GetDragDropFileName_1(object sender, AxIMAGEKIT7Lib._IImageKitEvents_GetDragDropFileNameEvent e)
		{
			ImageKit1.File.FileName = e.fileName;
			ImageKit1.File.LoadPage = e.page;
			ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad);
			ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale);
		}

		//magnifying glass
		private void ImageKit1_MouseMoveImage_1(object sender, AxIMAGEKIT7Lib._IImageKitEvents_MouseMoveImageEvent e)
		{
			if (Check10.Checked)
			{
				ImageKit1.Magnifier.Width = 100;
				ImageKit1.Magnifier.Height = 100;
				ImageKit1.Magnifier.Show(true, e.x, e.y, Convert.ToDouble(Label1.Text) * 2);
			}
		}

		private void ImageKit1_Progress(object sender, AxIMAGEKIT7Lib._IImageKitEvents_ProgressEvent e)
		{
			ProgressForm.progressBar1.Value = e.percent;

			if (ProgressForm.CancelFlag == true)
				ImageKit1.File.Cancel = true;
			else
				ImageKit1.File.Cancel = false;		

			Application.DoEvents();
		
		}

	}
}
