?
Solved

How to save a single frame from a movie?

Posted on 2001-08-15
5
Medium Priority
?
186 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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