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