SIGN UP MEMBER LOGIN:    
ARTICLE

Take Screen Shot From Media Element in WPF

Posted by Diptimaya Patra Articles | WPF with C# February 22, 2010
In this article we will see how can we take the screenshot of the Media (Video) we are playing.
Reader Level:
Download Files:
 

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.

Crating WPF Application Project

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

MediaElement1.gif

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.

MediaElement2.gif

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.

MediaElement3.gif

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

MediaElement4.gif

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

MediaElement5.gif

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

MediaElement6.gif

Hope this article helps.

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor