We can capture your desktop by using the following code.
Use the following namespaces
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Windows.Forms.VisualStyles; using System.Drawing.Drawing2D;
Use the following code
System.Windows.Forms.PictureBox MyPictureBox = new System.Windows.Forms.PictureBox(); Bitmap MyBitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); Graphics MyGraphics = Graphics.FromImage(MyBitmap); MyGraphics.CopyFromScreen(0, 0, 0, 0, MyBitmap.Size); MyGraphics.Dispose(); MyPictureBox.Image = MyBitmap; MyPictureBox.Size = MyBitmap.Size;
Code Explanation
1. Create an instance of PictureBox 2. Create an instance of Bitmap by capturing the current screen 3. By using the class Graphics form a Bitmap 4. Assign the Image into the Picturebox
By Nathan
|
No responses found. Be the first to respond and make money from revenue sharing program.
|