import snapshot crash...

Sarah Reichelt sarah.reichelt at gmail.com
Thu Jan 12 16:16:57 EST 2006


> Then along comes the MacFormat CD with 2.2.1 on it.  Yippee!  So I
> tried my 1.1.1 stack in 2.2.1 and the import snapshot script crashes
> the IDE and an OS X standalone built containing it.  This is the script
> almost in its entirety:
>
>    get "Circres(charts("& "CChrt_" & the system date &"_"& the long time
> & ".png"
>    replace "/" with "-" in it
>    replace ":" with "." in it
>    replace "(" with "/" in it
>    put it into tname
>    put the backgroundcolor of this card into tbcolour
>    set the backgroundcolor of this card to white
>    get the windowid of this stack
>    put the rect of grc "clipframe" into tbox
>    import snapshot from rect tbox of window it
>    select image 1 of this card
>    export png to file tname
>    delete the selectedobject
>    set the backgroundcolor of this card to tbcolour
>    send mouseup to button "show rest"
>    show field "export done"
>    wait 60 ticks
>    hide field "export done"
>
> Using the debugger, everything seems OK 'til it hits the import
> snapshot from rect tbox of window it
> line, and then foom!  I have checked the archives, and can see some old
> (2001) posts, but no workarounds or fixes.
>
> (using 2.2.1 on OS 10.3.9, 1 gig RAM)

Hi David,

There was a problem with early version 2 releases where importing from
a window ID crashed the app. My workaround (until 2.5 fixed it) was
for my snapshot script to position the window I wanted to snapshot in
a set place on the screen, make sure it was at the front and then take
a snapshot of the area I wanted using global coordinates. A bit clunky
but it works.

Cheers,
Sarah



More information about the use-livecode mailing list