Resources » Code Snippets » Winforms Controls

Capture DeskTop Screen


Posted Date: 19-May-2008  Last Updated:   Category: Winforms Controls    
Author: Member Level: Silver    Points: 5



//Add thid Name Space to your Class File

using System.Drawing.Imaging;
using System.Drawing;


////Add Button Control and Chaange Button name as"btnCapture" and paste this coding

this.Hide();
Bitmap Bitmap;
Graphics Graps;

Bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graps = Graphics.FromImage(Bitmap);
Graps.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y,0,0,Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Bitmap.Save(System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop )+"\\YourShot.jpeg" , ImageFormat.Jpeg);
MessageBox.Show("Your Screen Shot Save in Desktop");
this.Show();


Did you like this resource? Share it with your friends and show your love!

Responses to "Capture DeskTop Screen"
Author: vijetha    20 May 2008Member Level: Gold   Points : 2
i did not understood what is the purpose of capturing desktop screen,what the output i will get


Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Active Members
    Today
      Last 7 Daysmore...

      Awards & Gifts
      Talk to Webmaster Tony John
      Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India