How to put the first frame of a movie into an image object?

Klaus Major klaus at major-k.de
Thu Jul 24 11:53:01 EDT 2003


Hi Barry,

> Ignoring the crash that occurs in OSX when you attempt to print a card 
> containing a player object referencing a QT movie, let's say I've 
> overcome that (by developing in OS9 or Windows and assuming that the 
> compiled app doesn't exhibit the crashing problem).
>
> Now I need to develop a workaround. Here's the rough sequence of 
> events I think I'd need to do in order to print the first frame of the 
> movie:
>
> 1. select/copy the first frame of the movie. (Don't see a way of doing 
> this in Transcript.)

I do :-)

on mouseup
   set the currenttime of player 1 to 0
   ## rewind to start if necessary...
   import snapshot from rect globalloc(the topleft of player 1)& "," & 
globalloc(the botright of player 1)
end mouseup

Or pick some of these lines ;-)

on mouseup
   lock screen
   import snapshot from rect globalloc(the topleft of player 1)& "," & 
globalloc(the botright of player 1)
   set the loc of img -1 to the loc of player 1
   ## adjust the snapshot image, its the last one (layer-wise :-)
   hide player 1
   unlock screen
   ## do your print stuff here...
   lock screen
   delete img -1
   show player 1
   unlock screen
end mouseup

> 2. paste that frame (the clipboard) into a selected image object. 
> (seems to be do-able.)

No need to use the clipboard...

> 3. hide the player object (which does prevent the crash when you print 
> the card). (no problem.)

See above...

> Is there a way of scripting the first item within Rev?

Yo, hope that helps...

> Thanks,
> Barry

Regards

Klaus Major
klaus at major-k.de
www.major-k.de




More information about the use-livecode mailing list