How to Captures the screen to a Bitmap object

Will be posting article on how to create simple application, with full working code in C#
And welcome to anyone who want to post their own article
Post Reply
User avatar

Topic author
Site Admin
Site Admin
Man of action
Man of action
Posts: 1330
Joined: Sat Apr 16, 2011 7:49 am
Location: Montreal, Canada

How to Captures the screen to a Bitmap object


Post by Superl »

Captures the screen to a Bitmap object Introduction:
This method performs a bit-block transfer of the color data, from the full screen to the drawing surface of the Graphics.

Code: Select all

/// <summary>
/// A method to capture the screen to a Bitmap object
/// </summary>
/// <returns>A Bitmap object of the current screen</returns>
public static Bitmap CaptureScreen ()
Bitmap BMP = new Bitmap(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,

System.Drawing.Graphics GFX = System.Drawing.Graphics.FromImage(BMP);
GFX.CopyFromScreen (System.Windows.Forms.Screen.PrimaryScreen.Bounds.X,
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Y, 0, 0,

return BMP;

Come and say hello in here
Any donation will help click here please.

Have a nice day :103:
Post Reply

Return to “Coding Forum”