Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hello!

I've been trying to create a project in VS 2012 that would behave similar to the 'Snipping Tool' in Windows. Starting with the basics, I have been searching high and low for a way that I could capture a screenshot of the whole screen and save it to a JPG or PNG file.

Most of the solutions I have found so far are for WinForms applications, and I really want to build it in WPF. I also don't want to invoke the PrtScr key (unless there is a way I can restore the user's clipboard to its original state afterwards). The other solutions I have found are in C#, which I don't have enough experience with.

Could anybody here offer me some guidance or a starting point, it would be greatly appreciated! :)

Thanks in advance,

Will
Posted
Comments
Prasad Khandekar 8-Oct-13 11:38am    
Hello Will,


Please check these projects. (http://sourceforge.net/projects/screencapturewp/)/(http://www.codeproject.com/Articles/91487/Screen-Capture-in-WPF-WinForms-Application)

Regards,
Sergey Alexandrovich Kryukov 8-Oct-13 13:04pm    
Will you post it as a formal answer? I think if would be enough to close the problem.
—SA
Will Taylor 8-Oct-13 14:30pm    
Hi Prasad, thank you for your constructive reply. Unfortunately, both the SourceForge and Code Project example are for C#. Sorry, I should have been clearer in my post, I am looking for a VB.Net solution. Do you have any further examples?
Sergey Alexandrovich Kryukov 8-Oct-13 13:06pm    
You did not search well...
—SA
Will Taylor 8-Oct-13 14:06pm    
I did?

1 solution

Look more thoroughly. The problem is really simple. For example: http://www.codeproject.com/search.aspx?q=WPF+capture+screen&doctypeid=5[^].

And this is only on CodeProject; but you can also Google. And the solution will be just few lines of code.

—SA
 
Share this answer
 
Comments
Will Taylor 8-Oct-13 14:47pm    
Thank you for providing some links, however, having looked more 'thoroughly' at those articles and others on the site, I still can't find what I'm looking for. Your article (http://www.codeproject.com/Answers/657776/WPF-Rectangle-capture#answer1)came close to what I was looking for, but it is in C#, and the attempt to convert to VB.NET did not work in WPF (it seems there is no 'graphics' namespace). Thanks for trying anyway.
Sergey Alexandrovich Kryukov 8-Oct-13 16:02pm    
What, you don't know how to translate to VB.NET automatically? It's pretty easy...
And, for the record, if you need help in .NET, it's important to understand at least some C#. In real life, code for .NET is developed in C#, face it.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900