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 Command19;
		public System.Windows.Forms.Button Command18;
		public System.Windows.Forms.Button Command17;
		public System.Windows.Forms.Button Command16;
		public System.Windows.Forms.Button Command15;
		public System.Windows.Forms.Button Command14;
		public System.Windows.Forms.Button Command13;
		public System.Windows.Forms.Button Command12;
		public System.Windows.Forms.Button Command11;
		public System.Windows.Forms.Button Command10;
		public System.Windows.Forms.Button Command9;
		public System.Windows.Forms.Button Command8;
		public System.Windows.Forms.Button Command7;
		public System.Windows.Forms.Button Command6;
		public System.Windows.Forms.Button Command5;
		public System.Windows.Forms.Button Command4;
		public System.Windows.Forms.Button Command2;
		public System.Windows.Forms.GroupBox Frame1;
		public System.Windows.Forms.Button Command3;
		public System.Windows.Forms.Button Command1;
		/// <summary>
		///
		/// </summary>
		private System.ComponentModel.Container components = null;
		public System.Windows.Forms.RadioButton Option1_0;
		private AxIMAGEKIT7Lib.AxImageKit ImageKit1;
		public System.Windows.Forms.RadioButton Option1_1;
		public System.Windows.Forms.TextBox Text1;

		private Form2 ProgressForm;


		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.Command19 = new System.Windows.Forms.Button();
			this.Command18 = new System.Windows.Forms.Button();
			this.Command17 = new System.Windows.Forms.Button();
			this.Command16 = new System.Windows.Forms.Button();
			this.Command15 = new System.Windows.Forms.Button();
			this.Command14 = new System.Windows.Forms.Button();
			this.Command13 = new System.Windows.Forms.Button();
			this.Command12 = new System.Windows.Forms.Button();
			this.Command11 = new System.Windows.Forms.Button();
			this.Command10 = new System.Windows.Forms.Button();
			this.Command9 = new System.Windows.Forms.Button();
			this.Command8 = new System.Windows.Forms.Button();
			this.Command7 = new System.Windows.Forms.Button();
			this.Command6 = new System.Windows.Forms.Button();
			this.Command5 = new System.Windows.Forms.Button();
			this.Command4 = new System.Windows.Forms.Button();
			this.Command2 = new System.Windows.Forms.Button();
			this.Frame1 = new System.Windows.Forms.GroupBox();
			this.Option1_0 = new System.Windows.Forms.RadioButton();
			this.Option1_1 = new System.Windows.Forms.RadioButton();
			this.Command3 = new System.Windows.Forms.Button();
			this.Command1 = new System.Windows.Forms.Button();
			this.ImageKit1 = new AxIMAGEKIT7Lib.AxImageKit();
			this.Text1 = new System.Windows.Forms.TextBox();
			this.Frame1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.ImageKit1)).BeginInit();
			this.SuspendLayout();
			// 
			// Command19
			// 
			this.Command19.BackColor = System.Drawing.SystemColors.Control;
			this.Command19.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command19.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command19.Location = new System.Drawing.Point(360, 468);
			this.Command19.Name = "Command19";
			this.Command19.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command19.Size = new System.Drawing.Size(89, 44);
			this.Command19.TabIndex = 49;
			this.Command19.Text = "Canvas";
			this.Command19.Click += new System.EventHandler(this.Command19_Click);
			// 
			// Command18
			// 
			this.Command18.BackColor = System.Drawing.SystemColors.Control;
			this.Command18.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command18.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command18.Location = new System.Drawing.Point(272, 468);
			this.Command18.Name = "Command18";
			this.Command18.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command18.Size = new System.Drawing.Size(89, 44);
			this.Command18.TabIndex = 48;
			this.Command18.Text = "Lens";
			this.Command18.Click += new System.EventHandler(this.Command18_Click);
			// 
			// Command17
			// 
			this.Command17.BackColor = System.Drawing.SystemColors.Control;
			this.Command17.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command17.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command17.Location = new System.Drawing.Point(184, 468);
			this.Command17.Name = "Command17";
			this.Command17.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command17.Size = new System.Drawing.Size(89, 44);
			this.Command17.TabIndex = 47;
			this.Command17.Text = "WhirPinch";
			this.Command17.Click += new System.EventHandler(this.Command17_Click);
			// 
			// Command16
			// 
			this.Command16.BackColor = System.Drawing.SystemColors.Control;
			this.Command16.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command16.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command16.Location = new System.Drawing.Point(96, 468);
			this.Command16.Name = "Command16";
			this.Command16.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command16.Size = new System.Drawing.Size(89, 44);
			this.Command16.TabIndex = 46;
			this.Command16.Text = "Ripple";
			this.Command16.Click += new System.EventHandler(this.Command16_Click);
			// 
			// Command15
			// 
			this.Command15.BackColor = System.Drawing.SystemColors.Control;
			this.Command15.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command15.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command15.Location = new System.Drawing.Point(8, 468);
			this.Command15.Name = "Command15";
			this.Command15.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command15.Size = new System.Drawing.Size(89, 44);
			this.Command15.TabIndex = 45;
			this.Command15.Text = "Wave";
			this.Command15.Click += new System.EventHandler(this.Command15_Click);
			// 
			// Command14
			// 
			this.Command14.BackColor = System.Drawing.SystemColors.Control;
			this.Command14.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command14.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command14.Location = new System.Drawing.Point(452, 344);
			this.Command14.Name = "Command14";
			this.Command14.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command14.Size = new System.Drawing.Size(105, 27);
			this.Command14.TabIndex = 44;
			this.Command14.Text = "Clear Selection";
			this.Command14.Click += new System.EventHandler(this.Command14_Click);
			// 
			// Command13
			// 
			this.Command13.BackColor = System.Drawing.SystemColors.Control;
			this.Command13.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command13.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command13.Location = new System.Drawing.Point(360, 432);
			this.Command13.Name = "Command13";
			this.Command13.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command13.Size = new System.Drawing.Size(89, 36);
			this.Command13.TabIndex = 43;
			this.Command13.Text = "Motion Blur";
			this.Command13.Click += new System.EventHandler(this.Command13_Click);
			// 
			// Command12
			// 
			this.Command12.BackColor = System.Drawing.SystemColors.Control;
			this.Command12.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command12.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command12.Location = new System.Drawing.Point(272, 432);
			this.Command12.Name = "Command12";
			this.Command12.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command12.Size = new System.Drawing.Size(89, 36);
			this.Command12.TabIndex = 39;
			this.Command12.Text = "Grayscale";
			this.Command12.Click += new System.EventHandler(this.Command12_Click);
			// 
			// Command11
			// 
			this.Command11.BackColor = System.Drawing.SystemColors.Control;
			this.Command11.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command11.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command11.Location = new System.Drawing.Point(184, 432);
			this.Command11.Name = "Command11";
			this.Command11.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command11.Size = new System.Drawing.Size(89, 36);
			this.Command11.TabIndex = 38;
			this.Command11.Text = "Antialias";
			this.Command11.Click += new System.EventHandler(this.Command11_Click);
			// 
			// Command10
			// 
			this.Command10.BackColor = System.Drawing.SystemColors.Control;
			this.Command10.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command10.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command10.Location = new System.Drawing.Point(96, 432);
			this.Command10.Name = "Command10";
			this.Command10.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command10.Size = new System.Drawing.Size(89, 36);
			this.Command10.TabIndex = 37;
			this.Command10.Text = "Resize";
			this.Command10.Click += new System.EventHandler(this.Command10_Click);
			// 
			// Command9
			// 
			this.Command9.BackColor = System.Drawing.SystemColors.Control;
			this.Command9.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command9.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command9.Location = new System.Drawing.Point(8, 432);
			this.Command9.Name = "Command9";
			this.Command9.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command9.Size = new System.Drawing.Size(89, 36);
			this.Command9.TabIndex = 36;
			this.Command9.Text = "Blur";
			this.Command9.Click += new System.EventHandler(this.Command9_Click);
			// 
			// Command8
			// 
			this.Command8.BackColor = System.Drawing.SystemColors.Control;
			this.Command8.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command8.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command8.Location = new System.Drawing.Point(360, 396);
			this.Command8.Name = "Command8";
			this.Command8.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command8.Size = new System.Drawing.Size(89, 35);
			this.Command8.TabIndex = 35;
			this.Command8.Text = "Mosaic";
			this.Command8.Click += new System.EventHandler(this.Command8_Click);
			// 
			// Command7
			// 
			this.Command7.BackColor = System.Drawing.SystemColors.Control;
			this.Command7.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command7.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command7.Location = new System.Drawing.Point(272, 396);
			this.Command7.Name = "Command7";
			this.Command7.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command7.Size = new System.Drawing.Size(89, 35);
			this.Command7.TabIndex = 34;
			this.Command7.Text = "Rotation";
			this.Command7.Click += new System.EventHandler(this.Command7_Click);
			// 
			// Command6
			// 
			this.Command6.BackColor = System.Drawing.SystemColors.Control;
			this.Command6.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command6.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command6.Location = new System.Drawing.Point(184, 396);
			this.Command6.Name = "Command6";
			this.Command6.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command6.Size = new System.Drawing.Size(89, 35);
			this.Command6.TabIndex = 33;
			this.Command6.Text = "Emboss";
			this.Command6.Click += new System.EventHandler(this.Command6_Click);
			// 
			// Command5
			// 
			this.Command5.BackColor = System.Drawing.SystemColors.Control;
			this.Command5.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command5.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command5.Location = new System.Drawing.Point(96, 396);
			this.Command5.Name = "Command5";
			this.Command5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command5.Size = new System.Drawing.Size(89, 35);
			this.Command5.TabIndex = 32;
			this.Command5.Text = "Outline";
			this.Command5.Click += new System.EventHandler(this.Command5_Click);
			// 
			// 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(8, 396);
			this.Command4.Name = "Command4";
			this.Command4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command4.Size = new System.Drawing.Size(89, 35);
			this.Command4.TabIndex = 31;
			this.Command4.Text = "Sharpen";
			this.Command4.Click += new System.EventHandler(this.Command4_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(460, 124);
			this.Command2.Name = "Command2";
			this.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command2.Size = new System.Drawing.Size(97, 36);
			this.Command2.TabIndex = 30;
			this.Command2.Text = "Save";
			this.Command2.Click += new System.EventHandler(this.Command2_Click);
			// 
			// Frame1
			// 
			this.Frame1.BackColor = System.Drawing.SystemColors.Control;
			this.Frame1.Controls.Add(this.Option1_0);
			this.Frame1.Controls.Add(this.Option1_1);
			this.Frame1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame1.Location = new System.Drawing.Point(460, 232);
			this.Frame1.Name = "Frame1";
			this.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame1.Size = new System.Drawing.Size(97, 79);
			this.Frame1.TabIndex = 29;
			this.Frame1.TabStop = false;
			this.Frame1.Text = "Display";
			// 
			// 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 = 4;
			this.Option1_0.TabStop = true;
			this.Option1_0.Text = "Scale";
			this.Option1_0.Click += new System.EventHandler(this.Option1_0_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(8, 52);
			this.Option1_1.Name = "Option1_1";
			this.Option1_1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Option1_1.Size = new System.Drawing.Size(84, 17);
			this.Option1_1.TabIndex = 3;
			this.Option1_1.TabStop = true;
			this.Option1_1.Text = "Actual Size";
			this.Option1_1.Click += new System.EventHandler(this.Option1_1_Click);
			// 
			// Command3
			// 
			this.Command3.BackColor = System.Drawing.SystemColors.Control;
			this.Command3.Cursor = System.Windows.Forms.Cursors.Default;
			this.Command3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Command3.Location = new System.Drawing.Point(460, 176);
			this.Command3.Name = "Command3";
			this.Command3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command3.Size = new System.Drawing.Size(97, 36);
			this.Command3.TabIndex = 28;
			this.Command3.Text = "Exit";
			this.Command3.Click += new System.EventHandler(this.Command3_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(460, 72);
			this.Command1.Name = "Command1";
			this.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Command1.Size = new System.Drawing.Size(97, 36);
			this.Command1.TabIndex = 27;
			this.Command1.Text = "Load";
			this.Command1.Click += new System.EventHandler(this.Command1_Click);
			// 
			// ImageKit1
			// 
			this.ImageKit1.Location = new System.Drawing.Point(8, 68);
			this.ImageKit1.Name = "ImageKit1";
			this.ImageKit1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("ImageKit1.OcxState")));
			this.ImageKit1.Size = new System.Drawing.Size(436, 321);
			this.ImageKit1.TabIndex = 50;
			this.ImageKit1.Progress += new AxIMAGEKIT7Lib._IImageKitEvents_ProgressEventHandler(this.ImageKit1_Progress);
			// 
			// Text1
			// 
			this.Text1.AcceptsReturn = true;
			this.Text1.AutoSize = false;
			this.Text1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
			this.Text1.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.Text1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Text1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
			this.Text1.Location = new System.Drawing.Point(4, 0);
			this.Text1.MaxLength = 0;
			this.Text1.Multiline = true;
			this.Text1.Name = "Text1";
			this.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Text1.Size = new System.Drawing.Size(552, 64);
			this.Text1.TabIndex = 51;
			this.Text1.Text = @"This sample illustrates some of the effect filters and transformations that can be done with the ImageKit. In this sample, transformations are applied to the total image. The effect filters are applied to the total image unless an area has been selected with the mouse. For more information about effect filters and transformations, please refer to the Effect interface in the ImageKit Help documentation";
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(568, 514);
			this.Controls.Add(this.Text1);
			this.Controls.Add(this.ImageKit1);
			this.Controls.Add(this.Command19);
			this.Controls.Add(this.Command18);
			this.Controls.Add(this.Command17);
			this.Controls.Add(this.Command16);
			this.Controls.Add(this.Command15);
			this.Controls.Add(this.Command14);
			this.Controls.Add(this.Command13);
			this.Controls.Add(this.Command12);
			this.Controls.Add(this.Command11);
			this.Controls.Add(this.Command10);
			this.Controls.Add(this.Command9);
			this.Controls.Add(this.Command8);
			this.Controls.Add(this.Command7);
			this.Controls.Add(this.Command6);
			this.Controls.Add(this.Command5);
			this.Controls.Add(this.Command4);
			this.Controls.Add(this.Command2);
			this.Controls.Add(this.Frame1);
			this.Controls.Add(this.Command3);
			this.Controls.Add(this.Command1);
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Form1";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.Closed += new System.EventHandler(this.Form1_Closed);
			this.Frame1.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)
		{
			Option1_0.Checked = true;
			ImageKit1.RectDraw = true;
			ProgressForm = new Form2();
		}


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

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

			if (ImageKit1.ImageKind != IMAGEKIT7Lib.ImageKindConstants.ikRasterImage)
			{
				// No Raster Image
				ImageKit1.FreeMemory(ImageKit1.ImageHandle);
				return;
			}

			ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale);
			Option1_0.Checked = true;
		}

		//save
		private void Command2_Click(object sender, System.EventArgs e)
		{
			if (ImageKit1.ImageHandle == 0) return;
			if (ImageKit1.File.SaveFileDialog() == false) return;

			ImageKit1.File.SaveFile(IMAGEKIT7Lib.SaveFileConstants.ikSaveBMP, 0); //BMP Save
			ProgressForm.Hide();
		}

		private void Option1_0_Click(object sender, System.EventArgs e)
		{
			ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikScale);
			Option1_0.Checked = true;
		}

		private void Option1_1_Click(object sender, System.EventArgs e)
		{
			ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikActualSize);
			Option1_1.Checked = true;		
		}

		//clear selection
		private void Command14_Click(object sender, System.EventArgs e)
		{
			ImageKit1.RectLeft = 0;
			ImageKit1.RectRight = 0;
			ImageKit1.RectTop = 0;
			ImageKit1.RectBottom = 0;
		}

		//effect execute
		private void EffectProc(short No)
		{
			bool Ret = false;
			int []x = new int[4];
			int []y = new int[4];
			short n;
		
			if (ImageKit1.ImageHandle == 0) return;
		
			x[0] = ImageKit1.RectLeft;  y[0] = ImageKit1.RectTop;
			x[1] = ImageKit1.RectRight; y[1] = ImageKit1.RectTop;
			x[2] = ImageKit1.RectRight; y[2] = ImageKit1.RectBottom;
			x[3] = ImageKit1.RectLeft;  y[3] = ImageKit1.RectBottom;
			n = 4;
		
			ProgressForm.Show();
			ImageKit1.Effect.InOut = IMAGEKIT7Lib.InOutSelectModeConstants.ikInside;
			ImageKit1.Effect.SelectMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectPolygon;
			if (ImageKit1.RectLeft == 0 && ImageKit1.RectTop == 0 && ImageKit1.RectRight == 0 && ImageKit1.RectBottom == 0)
				ImageKit1.Effect.SelectMode = IMAGEKIT7Lib.AreaSelectModeConstants.ikEffectAll;

			switch (No)
			{
				case  4:
					Ret = ImageKit1.Effect.Sharp(ref x[0], ref y[0], n, 3);
					break;
				case  5:
					Ret = ImageKit1.Effect.Outline(ref x[0], ref y[0], n, 0, 0, 10);
					break;
				case  6:
					Ret = ImageKit1.Effect.Emboss(ref x[0], ref y[0], n, 0, 3, 128);
					break;
				case  8:
					Ret = ImageKit1.Effect.Mosaic(ref x[0], ref y[0], n, 10, 10);
					break;			
				case  9:
					Ret = ImageKit1.Effect.Blur(ref x[0], ref y[0], n, 5);
					break;			
				case 11:
					Ret = ImageKit1.Effect.AntiAlias(ref x[0], ref y[0], n);
					break;
				case 12:
					Ret = ImageKit1.Effect.Chroma(ref x[0], ref y[0], n, -100);
					break;
				case 13:
					Ret = ImageKit1.Effect.MotionBlur(ref x[0], ref y[0], n, 2, 30, 20);
					break;
				case 15:
					Ret = ImageKit1.Effect.Waves(ref x[0], ref y[0], n, 0, 0, 100, 10, 0.5, 1, 0, 0, 0);
					break;
				case 16:
					Ret = ImageKit1.Effect.Ripple(ref x[0], ref y[0], n, 20, 10, 0.5, false, false, 0, 0, 0);
					break;
				case 17:
					Ret = ImageKit1.Effect.WhirlPinch(ref x[0], ref y[0], n, 360, 1, 1, 0, 0, 0);
					break;
				case 18:
					Ret = ImageKit1.Effect.Lens(ref x[0], ref y[0], n, 3.0, false, 0, 0, 0);
					break;
				case 19:
					Ret = ImageKit1.Effect.Canvas(ref x[0], ref y[0], n, 1, 20);
					break;

			}

			ProgressForm.Hide();
			if (Ret == false) return;
		
			ImageKit1.CtlRefresh();		
		}

		//sharpen
		private void Command4_Click(object sender, System.EventArgs e)
		{
			EffectProc(4);
		}

		//outline
		private void Command5_Click(object sender, System.EventArgs e)
		{
			EffectProc(5);
		}

		//embos
		private void Command6_Click(object sender, System.EventArgs e)
		{
			EffectProc(6);		
		}

		//rotation
		private void Command7_Click(object sender, System.EventArgs e)
		{
			bool Ret;

			if (ImageKit1.ImageHandle == 0) return;
		
			ProgressForm.Show();
			Ret = ImageKit1.Effect.Rotation(3000, false, false, true, 255, 255, 255, false);
			ProgressForm.Hide();
			if (Ret == false) return;
		
			ImageKit1.CtlRefresh();		
		}

		//mosaic
		private void Command8_Click(object sender, System.EventArgs e)
		{
			EffectProc(8);		
		}

		//blur
		private void Command9_Click(object sender, System.EventArgs e)
		{
			EffectProc(9);				
		}

		//resize
		private void Command10_Click(object sender, System.EventArgs e)
		{
			bool Ret;

			if (ImageKit1.ImageHandle == 0) return;
		
			ProgressForm.CancelFlag = false;
			ProgressForm.Show();
			Ret = ImageKit1.Effect.Resize(500, 500, true); 
			ProgressForm.Hide();
			if (Ret == false) return;
		
			ImageKit1.CtlRefresh();
		}

		//anti alias
		private void Command11_Click(object sender, System.EventArgs e)
		{
			EffectProc(11);
		}

		//grayscale
		private void Command12_Click(object sender, System.EventArgs e)
		{
			EffectProc(12);
		}

		//motion blur
		private void Command13_Click(object sender, System.EventArgs e)
		{
			EffectProc(13);
		}

		//wave
		private void Command15_Click(object sender, System.EventArgs e)
		{
			EffectProc(15);		
		}

		//ripple
		private void Command16_Click(object sender, System.EventArgs e)
		{
			EffectProc(16);		
		}

		//WhirPinch
		private void Command17_Click(object sender, System.EventArgs e)
		{
			EffectProc(17);		
		}

		//lens
		private void Command18_Click(object sender, System.EventArgs e)
		{
			EffectProc(18);		
		}

		//canvas
		private void Command19_Click(object sender, System.EventArgs e)
		{
			EffectProc(19);
		}

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

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

			Application.DoEvents();
		
		}

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

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


	}
}
