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);
            });
        }
Exemple #2
0
        private void pictureBox2_Paint_MouseMove(object sender, MouseEventArgs e)
        {
            if (isChoosed == false)
            {
                return;
            }
            if (in_box_flag == 1 && pen_type == 0)
            {
                //Console.WriteLine(e.Location.X + "," + e.Location.Y + "  " + flag);
                if (lastP.X == -1)
                {
                    Console.WriteLine("in");
                    lastP = e.Location;
                    return;
                }
                else
                {
                    SolidBrush solidBrush = new SolidBrush(choose_color);

                    Pen pen = new Pen(solidBrush, trackBar_Paint.Value);


                    myDrawLine(pen, lastP, e.Location);

                    lastP = e.Location;
                }
            }
            if (in_box_flag == 1 && pen_type == 1)
            {
                Bitmap dstBmp;

                ProcessFunctions.setMosaic(bitmap, e.Location, pictureBox_WorkPlace.Size, trackBar_Paint.Value, out dstBmp);
                //Console.WriteLine("Image size:"+ this.pictureBox_WorkPlace.Image.Width);
                this.pictureBox_WorkPlace.Image = ToolFunctions.GetThumbnail((Bitmap)dstBmp.Clone(), pictureBox_WorkPlace.Height, pictureBox_WorkPlace.Width);
                bitmap = new Bitmap(this.pictureBox_WorkPlace.Image);
            }
        }