Create Screen Shot with Media Element In WPF

No.of Views2128
Bookmarked0 times
Downloads 
Votes0
By  dpatra   On  30 Sep 2010 10:09:30
Tag : WPF , Utilities
In the previous article about Media Element in WPF, we saw some of the basic functionalities. In this article we will see how can we take the screen shot of the Media (Video) we are playing.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In the previous article about Media Element in WPF, we saw some of the basic functionalities. In this article we will see how can we take the screenshot of the Media (Video) we are playing.

Creating WPF Application Project

Fire up Visual Studio 2008 and Create a WPF Application and name the project as MediaSampleWPF. 

Image Loading

I am just extending the feature that we experienced in our last application titled “Media Element In WPF”.
We will just add another Button to take ScreenShot. See following figure. 

Image Loading

Now we will add an extension method that would help us capturing the Screen Shot.Create a static class and add the following method to it.

Image Loading

Now in the Button click event handler add the following code to use the extension method and save the file.

Image Loading

Now that our application is ready to go. Run the application. 

Image Loading

And when we capture it saves in the output directory (Bin folder of the project). 

Image Loading

Hope this article helps.

 
Sign Up to vote for this article
 
About Author
 
dpatra
Occupation-Not Provided
Company-Not Provided
Member Type-Expert
Location-Not Provided
Joined date-13 Jul 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top