Latest Version of RunRev?

Ken Ray kray at sonsothunder.com
Thu Jun 21 17:50:11 EDT 2007


On Thu, 21 Jun 2007 21:28:38 +0100, Dave wrote:

> Thanks got it now, was hoping it might fix my problem(s) but no sucj 
> luck, the IDE still crashes when I set "alwaysBuffer" to true as 
> before.
> 
> Really don't know what else to try now.

Dave, I just ran a test with your code and with minor modifications it 
works for me, so let me verify I'm doing it "right" and I *should* be 
getting a crash. Here's what I've got (Rev 2.8.1-gm-2, OS X 10.4.9):

- A stack with three controls on it: a player control called 
"PlayerThumbnail", an image control called "ImageThumbnail", and a 
button to execute the process.

- The button script has this code:

######
on mouseUp
  get PDFGetFrameThumbnail(10)  -- I tried it with a number of 
different frame numbers, of course
end mouseUp
######

The stack script has this code:

######
function PDFGetFrameThumbnail theFrameNumber
  local myCurrentTime
  local myImageData
  local myFrameRect
  local myWindowID

  --
  --  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
  --
  put theFrameNumber * 24 into myCurrentTime
  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)
  set the playSelection of player "PlayerThumbnail" of card 1 of me to 
true
  start player "PlayerThumbnail" of card 1 of me

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

  return myImageData
end PDFGetFrameThumbnail
######

The play object is not showing a controller, and its alwaysBuffer was 
set to false. The only thing I did in the script was comment out the 
line "set the alwaysBuffer of the templateImage to false" since the 
templateImage is only used when you *create a new image*, and you're 
not doing that in this script (the image "ImageThumbnail" already 
exists). 

Click the button, and it works as advertised with no crash... am I 
doing something wrong?


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list