private void button12_Click(object sender, EventArgs e) { Size picSize = new Size(); Image temp = ToolFunctions.GetInitThumbnail((Bitmap)bitmap.Clone(), pictureBox1.Height, pictureBox1.Width, out picSize) as Image; this.pictureBox1.Width = picSize.Width; //this.pictureBox1.Location = new Point(14 + 1097 / 2 - picSize.Width / 2, 25); this.pictureBox1.Image = temp; this.pictureBox1.MouseClick += new MouseEventHandler((o, me) => { ProcessFunctions.test_01(bitmap, me.Location, pictureBox1.Size); Console.WriteLine("location of Point:" + me.Location.X + "," + me.Location.Y); Bitmap outBmp; ProcessFunctions.setMosaic(bitmap, me.Location, pictureBox1.Size, 0, out outBmp); this.pictureBox1.Image = ToolFunctions.GetThumbnail(outBmp, pictureBox1.Height, pictureBox1.Width); //Console.WriteLine(pictureBox1.Width); }); this.pictureBox1.MouseMove += new MouseEventHandler((o, me) => { Bitmap outBmp; ProcessFunctions.setMosaic(bitmap, me.Location, pictureBox1.Size, 0, out outBmp); this.pictureBox1.Image = ToolFunctions.GetThumbnail(outBmp, pictureBox1.Height, pictureBox1.Width); bitmap = new Bitmap(this.pictureBox1.Image); }); }
//get button private void button1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { isChoosed = true; string path = openFileDialog1.FileName; bitmap = (Bitmap)Image.FromFile(path); origin_bmp = (Bitmap)bitmap.Clone(); reset(); Size picSize = new Size(); //pictureBox1.Image = ToolFunctions.GetThumbnail((Bitmap)bitmap.Clone(), pictureBox1.Height, pictureBox1.Width) as Image; Image temp = ToolFunctions.GetInitThumbnail((Bitmap)bitmap.Clone(), 723, 1097, out picSize) as Image; this.pictureBox_WorkPlace.Width = picSize.Width; this.pictureBox_WorkPlace.Height = picSize.Height; this.pictureBox_WorkPlace.Location = new Point(14 + 1097 / 2 - picSize.Width / 2, 25 + 723 / 2 - picSize.Height / 2); this.pictureBox_WorkPlace.Image = temp;//ToolFunctions.GetThumbnail((Bitmap)bitmap.Clone(), pictureBox_WorkPlace.Height, pictureBox_WorkPlace.Width); gReal = Graphics.FromImage(this.pictureBox_WorkPlace.Image); if (tabControl1.SelectedTab == null) { return; } foreach (Control control in tabControl1.SelectedTab.Controls) { control.Enabled = true; } } }