private void button8_Click(object sender, EventArgs e) { int loop = Int32.Parse(textLoop.Text); while (loop > 0) { loop--; //System.Drawing.Bitmap tempBit = new System.Drawing.Bitmap(Application.StartupPath + "\\" + textSubsystemBMP.Text); //System.Drawing.Rectangle rect = new System.Drawing.Rectangle( // Int32.Parse(textLeft.Text), // Int32.Parse(textTop.Text), // Int32.Parse(textRight.Text) - Int32.Parse(textLeft.Text), // Int32.Parse(textBottom.Text) - Int32.Parse(textTop.Text) // ); //System.Drawing.Bitmap block = tempBit.Clone(rect, tempBit.PixelFormat); //IntPtr hBitMap=tempBit.GetHbitmap(); ANNWrapper.SaveBlockToBMP2(Application.StartupPath + "\\" + textSubsystemBMP.Text, Int32.Parse(textLeft.Text), Int32.Parse(textTop.Text), Int32.Parse(textRight.Text), Int32.Parse(textBottom.Text), Application.StartupPath + "\\" + textToPath.Text); //ANNWrapper.SaveBlockToBMP3(block.GetHbitmap(), // Int32.Parse(textLeft.Text), // Int32.Parse(textTop.Text), // Int32.Parse(textRight.Text), // Int32.Parse(textBottom.Text), // Application.StartupPath + "\\" + textToPath.Text); //ANNWrapper.SaveBlockToBMP2(Application.StartupPath + "\\" + textSubsystemBMP.Text, // Int32.Parse(textLeft.Text), // Int32.Parse(textTop.Text), // Int32.Parse(textRight.Text), // Int32.Parse(textBottom.Text), // Application.StartupPath + "\\" + textToPath.Text); } }