예제 #1
0
        private void MirrorButton_Click(object sender, EventArgs e)
        {
            if (PictureBox1.Image == null)
            {
                alert.Show();
            }

            else
            {
                RedEffectlabel.Hide();
                BlueEffectlabel.Hide();
                GreenEffectlabel.Hide();
                MirrorLabel.Show();
                check = true;
                if (PictureBox1.Image == null)
                {
                    alert.Show();
                }
                else
                {
                    MirrorLabel.Visible      = true;
                    OriginalPicLabel.Visible = true;
                    panel1.Size         = new Size(400, 300);
                    PictureBox1.Size    = new Size(400, 300);
                    pictureBox2.Visible = true;

                    Bitmap bmp = new Bitmap(PictureBox1.Image);

                    int width  = bmp.Width;
                    int height = bmp.Height;

                    Bitmap btmp = new Bitmap(width * 2, height);

                    for (int y = 0; y < height; y++)
                    {
                        for (int lx = 0, rx = width * 2 - 1; lx < width; lx++, rx--)
                        {
                            Color p = bmp.GetPixel(lx, y);

                            btmp.SetPixel(lx, y, p);
                            btmp.SetPixel(rx, y, p);
                        }
                    }
                    pictureBox2.Size  = new Size(800, 300);
                    pictureBox2.Image = btmp;
                }
            }
        }
예제 #2
0
        private void GreenButton_Click(object sender, EventArgs e)
        {
            BlueEffectlabel.Hide();
            MirrorLabel.Hide();
            RedEffectlabel.Hide();
            OriginalPicLabel.Show();
            GreenEffectlabel.Show();
            check = true;
            Bitmap bmp = new Bitmap(PictureBox1.Image);

            pictureBox2.Visible = true;
            panel1.Size         = new Size(400, 300);

            PictureBox1.Size = new Size(400, 300);
            pictureBox2.Size = new Size(400, 300);
            int height = bmp.Height;
            int width  = bmp.Width;


            Bitmap gbmp = new Bitmap(bmp);

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    Color p = bmp.GetPixel(x, y);


                    int a = p.A;

                    int g = p.G;



                    gbmp.SetPixel(x, y, Color.FromArgb(a, 0, g, 0));
                }
            }

            PictureBox1.Image = image;
            pictureBox2.Image = gbmp;
        }
예제 #3
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     if (PictureBox1.Image == null)
     {
         alert.Show();
     }
     else
     {
         textBox1.Size        = new Size(172, 20);
         textBox1.Text        = null;
         count                = 0;
         PictureBox1.Size     = new Size(827, 598);
         PictureBox1.Location = new Point(0, 0);
         OriginalPicLabel.Hide();
         BlueEffectlabel.Hide();
         RedEffectlabel.Hide();
         GreenEffectlabel.Hide();
         panel1.Size = new Size(856, 598);
         MirrorLabel.Hide();
         pictureBox2.Hide();
         PictureBox1.Image = image;
         check             = false;
     }
 }