Export Snapshot - documentation issues

David Bovill david at openpartnership.net
Fri Aug 31 15:54:46 EDT 2007


I'm trying to get my head round the latest on "export snapshot"... it
seems there are a bunch of posts regarding memory leaks and syntax
problems. Certainly you can't use the syntax specified in the docs -
such as relative rects with the object form... so looking for some
advice.

Lets take a specific example - the aim is to take a picture of an
arbitrary group. Here is a script which fails (needs to use global
coordinates):

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

    switch imageType
        case "GIF"
            export snapshot from rect (the rect of targetObject) of
targetObject to someImage as GIF
            break
        case "JPG"
            export snapshot from rect (the rect of targetObject) of
targetObject to someImage as JPEG
            break
        case "JPEG"
            export snapshot from rect (the rect of targetObject) of
targetObject to someImage as JPEG
            break
        default
            export snapshot from rect (the rect of targetObject) of
targetObject to someImage as PNG
    end switch
    return someImage
end object_SnapShot

So - whats the best way to take snapshot of a group/control - I've
noticed from previous posts that people move objects offscreen and
similar tricks? I think the window needs to be top-most...
suggestions?



More information about the use-livecode mailing list