2

I'm working on a video player project (or something like that), that can play .avi files. I wanted to improve it with something "special", so I put a "Take snapshot" button (btnSnapshot) under the playback area, which is a Picture Box (picboxPlayback). I'm using DirectX.AudioVideoPlayback, and the video file's owner is this Picture Box:

Microsoft.DirectX.AudioVideoPlayback.Video myVideo = new Microsoft.DirectX.AudioVideoPlayback.Video(SelectedVideoPath);
myVideo.Owner = picboxPlayback;

Then I've tried to write the code that takes the snapshot from the current frame and saves it to a JPEG image to a user-defined path, but I've stuck when I realized that "Video" does not have any "TakeSnapshot" or such methods.

I looked on internet for a quick and simple solution, but did'nt find anything, or what I found was so complicated that I did'nt understand it. (probably because I'm too beginner to DirectX)

I don't know if there's even a quick and simple way to do this, but I would be very grateful if you could help me. :)

Richtenzorg
  • 178
  • 1
  • 1
  • 9
  • Hi Richtenzorg, did you solve this? If you did, please share your solution – jere_hr Jun 02 '14 at 20:26
  • 1
    Hi @jere_hr , I've searched everywhere, but I can't say I've found exactly what I was looking for yet. However there is a way to get almost the same result: First you have to pause the Video (if playback is running), set Video.FullScreen to true, then capture the whole screen to a Bitmap ([take a screenshot](http://stackoverflow.com/questions/362986/capture-the-screen-into-a-bitmap)), then set FullScreen back to false and save the image with Bitmap.Save(). But I don't think the user would always like the result, and it's not even the fastest solution. So I'm still searching. – Richtenzorg Jun 03 '14 at 20:50

0 Answers0