Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grab image of individual frame from QuickTime ActiveX?



At 07:40 28/02/2006, Sam Dutton wrote:
Thanks for the suggestion -- but is there any way to do this from the QuickTime ActiveX control?
 
(CopyFrame(...) isn't documented for the ActiveX control, and results in a "not found" error if I try to use it with int  or VARIANT or no argument.)

I'm assuming that the 'QuickTime ActiveX control' you refer to is the QuickTime COM/Active Control that shipped with QuickTime 7 i.e. the COM library is QTOControl.

If this is the case CopyFrame should work. This method is implemented by the QTMovie class and not the QTControl class. In order to obtain an instance of QTMovie you query the Movie property of QTControl after having loaded a movie.

Using the Qt (Qt not QuickTime) QAxContainer module:

  QAxWidget     *m_axQTControl = NULL;
  QAxObject     *m_axMovie = NULL;

  m_axQTControl = new QAxWidget( "QTOControl.QTControl", this );
  ...
  m_axQTControl->setProperty("URL", "D:\\Movies\\Sample.mov");
  ...
  m_axMovie = m_axQTControl->querySubObject( "Movie" );
  if ( m_axMovie )
  {
         m_axMovie->dynamicCall( "CopyFrame()" );        
  }


From: John Cromie [ mailto:email@hidden]
Sent: Thu 23/02/2006 21:18
To: email@hidden
Cc: Dutton, Sam
Subject: Re: Grab image of individual frame from QuickTime ActiveX?



At 20:05 23/02/2006, Sam Dutton wrote:
>I'm using the QuickTime ActiveX control in a Windows XP C++ app using
>the Qt framework.
>
>Is there any way to get an image of a single frame? I'm doing
>screengrabs for the moment, which is pretty hacky, though it works fine
>(just for a preview).

One way is to use the CopyFrame(VARIANT Time) method of QTMovie to
put a grab of the specified frame on the clipboard. Then in Qt you
can easily use QApplication::clipboard() (or the Win32 clipboard
functions) to get the image in a useable format.

Something like:

     VARIANT vTime;
     VariantInit(&vTime);
     V_I4(&vTime) = 0;      // or whatever movie time you want e.g. PosterTime

     movie->CopyFrame(vTime);

     QPixmap pm = QApplication::clipboard()->pixmap();
     if ( !pm.isNull() )
     {
         // Draw movie frame, etc.
     }

Hope this helps.

_________________________________________________________
John Cromie
Skylark Associates Ltd.             http://www.skylark.ie

_________________________________________________________
John Cromie
Skylark Associates Ltd.             http://www.skylark.ie

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.