image

Here is a code snippet:

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Show();
            Graphics myGraphics = this.CreateGraphics();
 
            Image memoryImage = new Bitmap(200, 180, myGraphics);
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
 
            int x = 0;
            int y = 0;
            int v = 1;
            int w = 1;
 
            while (run)
            {
                x += v; y += w;
                if (x >= Screen.PrimaryScreen.WorkingArea.Width - 200 || x <= 0) v = -v;
                if (y >= Screen.PrimaryScreen.WorkingArea.Height - 180 || y <= 0) w = -w;
                memoryGraphics.CopyFromScreen(x, y, 0, 0, new Size(200, 180));
                LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, 200, 180), 
			Color.Transparent, Color.Gold, LinearGradientMode.ForwardDiagonal);
                memoryGraphics.FillRectangle(brush, new Rectangle(0, 0, 200, 180));
                Application.DoEvents();
 
                pictureBox1.Image = memoryImage;
            }
        }
VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. C# Multiple Watermarking in same image
  2. c# Listbox – change color of items
  3. C program to draw a circle
  4. WPF – Cube rotation - animation
  5. Tool: ScreenScale