Export Snapshot - documentation issues

David Bovill david at openpartnership.net
Fri Aug 31 16:08:29 EDT 2007


A few experiments later....  and it seems the message is that the docs
are wrong - firstly there seems no point using "of object" form,
instead use only of "window windowID". Also the docs are wrong in that
you don't need the stack to be topmost - so the following script seems
to work fine at the moment:

getprop object_SnapShot [imageType]
    -- see also "image_GetSnapShot"
    put the long id of the target into targetObject
    put the stack_Object of targetObject into stackObject

    -- toplevel stackObject
    put the windowid of stackObject into wID
    put the rect of targetObject into localRect

    switch imageType
        case "GIF"
            export snapshot from rect localRect of window wID to
someImage as GIF
            break
        case "JPG"
            export snapshot from rect localRect of window wID to
someImage as JPEG
            break
        case "JPEG"
            export snapshot from rect localRect of window wID to
someImage as JPEG
            break
        default
            export snapshot from rect localRect of window wID to
someImage as PNG
    end switch
    return someImage
end object_SnapShot

I've updated the docs here (feel free to comment on / edit the wiki
page) - http://handlers.rev-co.de/wiki/export%2Bsnapshot.



More information about the use-livecode mailing list