Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to save a single frame from a movie?

Posted on 2001-08-15
5
Medium Priority
?
188 Views
Last Modified: 2012-05-04
Not sure if this is possible or not....

i'm using the TMediaPlayer in my app to play movies (avi,mpeg).

is it possible to save a single frame from the movie playing ?

now i dont mean opening the file and grabbing a single frame since this will differ depending on movietype...

i was more interested in somehow saving the current frame shown in the assigned Tpanel.

i've tried to make the Canvas propery for Tpanel available but not really sure where to go from there... (was kinda expecting the "SaveToFile" functions to come with it... but since it didn't i'm kinda stuck)


/John
0
Comment
Question by:Arachnid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 21

Expert Comment

by:gemarti
ID: 6389554
Well this doesn't work exactly the way you would expect unless you play the movie in ontop of the control but here is something to work with. Maybe you can perfect it.

Put an image, button and mediaplayer component on a form.

assign a movie to the media player and try this

procedure TForm1.Button1Click(Sender: TObject);
begin
  Image1.Canvas.CopyRect(Image1.ClientRect,Canvas,MediaPlayer1.DisplayRect);
  Image1.Picture.SaveToFile('c:\Test.bmp');
end;
0
 
LVL 21

Accepted Solution

by:
gemarti earned 800 total points
ID: 6390086
{Here is one off of the Panel1}

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, MPlayer, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    MediaPlayer1: TMediaPlayer;
    Button1: TButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 Image1.Canvas.CopyRect(Image1.ClientRect,Canvas,Panel1.BoundsRect);
 Image1.Picture.SaveToFile('c:\Test.bmp');
end;

end.


0
 

Expert Comment

by:bullen
ID: 6834343
http://home.t-online.de/home/Thomas.Schwobe/list11.htm

This code can give You any frame (Image) in an AVI file. You nead VFW.pas (about 180kB) and set Your Compiler to read from the "lib\delphi2" directory (Ole2 from delphi2) works fine for D4,5,6.

bullen
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8741881
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept gemarti's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question