Take Screen Shot in C#

There are many techniques to take screen shot in C#. One of these techniques that we are going to discuss to day is by using “PRTSC” command. It is a really simple for beginners. So, Let get Started.

Tools Required:

  1. Visual Studio 2010 or Later version.

Steps to Follow:

  1. First of all create a new windows forms application project in visual studio.
  2. Go to the designer view of your form and add a picture box to view the screenshot. Also add a button to capture screenshot.
  3. Go to the OnClick event of your button and add the following code:
      this.Hide();
            
            System.Threading.Thread.Sleep(1000);
            SendKeys.Send("{PRTSC}");
            Image myImage = Clipboard.GetImage();
            pictureBox1.Image = myImage;
            
            myImage.Save("E:\\abc.jpg");
            this.Show();
        }

but before this don’t forget to add the add the header file on the top of your code like:

using System.Drawing;

The above code will hide the form and Thread will delay the process upto 1000 milliseconds. The next line will automatically send the PrintScreen command to capture your screen. The captured screen will be saved in clipboard. Now, Next line will set that image on the picturebox of your form and save it inside E: drive of your computer. After this, the form will appear back.

Now just Run your app and test it. I hope it will work for you. 🙂

Video Tutorial:

Watch full video tutorial to learn how to take screen shot in C#

Full Video Tutorial

Source Code:

I hope you enjoyed this article. Thank you so much for visiting us. Please don’t forget to subscribe our official YouTube Channel C# Ui Academy

14 Replies to “Take Screen Shot in C#”

  1. It抯 really a nice and helpful piece of information. I am glad that you shared this useful info with us. Please keep us informed like this. Thank you for sharing.

  2. Everything is very open with a clear description of the challenges. It was definitely informative. Your website is extremely helpful. Many thanks for sharing!

  3. Very good info. Lucky me I ran across your site by chance (stumbleupon). I have bookmarked it for later!

  4. Great write-up, I¡¦m normal visitor of one¡¦s website, maintain up the excellent operate, and It’s going to be a regular visitor for a lengthy time.

  5. Aw, this was a very good post. Spending some time and actual effort to generate a really good article… but what can I say… I hesitate a lot and don’t manage to get anything done.

  6. Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our area library but I think I learned more clear from this post. I am very glad to see such magnificent info being shared freely out there.

  7. Hiya, I am really glad I have found this information. Nowadays bloggers publish only about gossip and internet stuff and this is actually irritating. A good site with interesting content, this is what I need. Thanks for making this web site, and I will be visiting again. Do you do newsletters by email?

Comments are closed.