Rev Crash Again! ... cardImage() function

Alejandro Tejada capellan2000 at yahoo.com
Fri Jan 9 18:26:19 EST 2004


on Fri, 9 Jan 2004 14:02:42 -0700
Dar Scott wrote:

> I like it!  Maybe theStack can be made optional,
> too.  If so, should it 
> be defaultStack or topStack?
> 
> Anybody have ideas on specifying the card?

Look at these additions:

In a button this handler calls the function:

on mouseUp
  create img
  set the text of it to cardsImage(MyTestStack,5)
end mouseUp

where "MyTestStack" is the stack name and 5 is the
card number.

additions marked as -- ****

function cardsImage theStack theCard   -- ****
  local tCurrentCardImage, tOldBuffer, tID
  put the topstack into qwerty         -- ****
  lock screen                          -- ****
  go to card theCard of stack thestack -- ****
  toplevel qwerty                      -- ****
  unlock screen                        -- ****
 put the alwaysBuffer of stack theStack into
tOldBuffer
 put the cantmodify of stack theStack into
tCMOldBuffer
  set the cantmodify of  stack theStack to false  
  set the alwaysBuffer of  stack theStack to false
  set the alwaysBuffer of stack theStack to true
  put the windowID of stack theStack into wID
  put the pixMapID of  stack theStack into pID
  if not ((pID is wID) or (pID is 0)) then
    create invisible image
    put the imagePixMapID of last image into tID
set the imagePixMapID of last image to (the pixMapID
of stack theStack) 
    export last image to tCurrentCardImage as PNG
    set the imagePixMapID of last image to tID
    set the alwaysBuffer of stack theStack to false
set the cantmodify of stack theStack to tCMOldBuffer  
    delete last image
  end if
  return tCurrentCardImage
end cardsImage

al



=====
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


More information about the use-livecode mailing list