Player/Image Object "always buffer" Problems

Dave dave at looktowindward.com
Wed Jun 20 14:36:13 EDT 2007


Hi,


With the switch to and from tool mode, the image and the player are  
one frame apart, e.g. it should run like this:

Frame    Player     Image
    22           22           --
    22           22         22

    27           27         22
    27           27         27

    32           32        27
    32           32        32

But instead it runs:

Frame    Player     Image
    22           22         --
    22           22         --

    27           27         --
    27           27         22

    32           32        22
    32           32        22

So I am getting the buffer from the *previous* frame of the player.

> Try not using imageData, use "the text of" or just "put" instead:
>
>   put myVar into image "imageThumbnail"
> or:
>   set the text of image "imageThumbnail" to myVar
>

I have changed the code to use the "set the text of" form, but it  
behaves the manner. Also the Stack is flakey, sometimes when I double- 
click on the player object in the IDE to get its property inspector,  
RunRev Crashes with unexpected quit.

Here is the modified function:

local sgOldImageData

------------------------------------------------------------------------ 
------------
--
--  PDFGetFrameThumbnail
--
------------------------------------------------------------------------ 
------------
function PDFGetFrameThumbnail theFrameNumber,theThumbnailFilePathName
   local myCurrentTime
   local myImageData
   local myFrameRect
   local myWindowID
   local myMovieFilePathName

   --
   --  Set up the Rectangle for the Player Frame
   --
   put the rect of player "PlayerThumbnail" of card 1 of me into  
myFrameRect
   put the windowID of this stack into myWindowID

   --
   --  Calculate the Position in the Movie and Play the Frame
   --
   put the fileName of player "PlayerThumbnail" of card 1 of me into  
myMovieFilePathName
   --set the filename of player "PlayerThumbnail" of card 1 of me to  
empty
   --set the fileName of player "PlayerThumbnail" of card 1 of me to  
myMovieFilePathName

   put theFrameNumber * 24 into myCurrentTime
   set the playSelection of player "PlayerThumbnail" of card 1 of me  
to true
   set the startTime of player "PlayerThumbnail" of card 1 of me to  
myCurrentTime
   set the endTime of player "PlayerThumbnail" of card 1 of me to  
(myCurrentTime + 1)
   start player "PlayerThumbnail" of card 1 of me

   choose pointer tool
   wait .25 seconds with messages

   --
   --  Grab the Frame
   --
   --put empty into image "ImageThumbnail" of card 1 of me
   put empty into myImageData
   set the alwaysBuffer of the templateImage to false
   export snapshot from rect myFrameRect of window myWindowID to  
myImageData as JPEG

   choose browse tool
   wait .25 seconds with messages

   set the text of image "ImageThumbnail" of card 1 of me to myImageData
   if myImageData = sgOldImageData then
     breakpoint
   end if

   wait 1 seconds with messages

   put myImageData into sgOldImageData
   return myImageData
end PDFGetFrameThumbnail




On 20 Jun 2007, at 17:42, J. Landman Gay wrote:
>
> There is a subtle difference between imagedata and the content (the  
> "text") of an image. In Scott Rossi's example, he also uses "text"  
> and it works.
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list