Пример #1
0
        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);
            });
        }