making a thumbnail from a snapshot

Peter Brigham MD pmbrig at gmail.com
Sat Feb 13 18:03:50 EST 2010


I'm trying to make a thumbnail from a snapshot of an image from  
another substack. First I clone a group that contains a thumbnail  
image and a text field, then I reposition the new group, then I try to  
get a new thumbnail into the new group. Here's what I've tried  
(partial script):

    clone group "imgItem 1"
    set the name of it to newGpName
    --  newGpName is already constructed, it is "imgItem k" for some k
    --  now set location of new group
    set the top of group newGpName to 30
    set the left of group newGpName to the left of group "imgItem 1"
    --  store the new rect of the thumbnail, then delete it
    put the rect of img "mThumb" of group newGpName into thumbRect
    delete img "mThumb" of group newGpName
    --  import new image into cloned group (last group)
    start editing group newGpName
    import snapshot from image "mDisplay" of stack "dispStack"
    --  rename image
    set the name of last image to "mThumb"
    stop editing background newGpName
    --  resize image to thumbnail size and location
    set the rect of img "mThumb" of group newGpName to thumbRect

What I get is not a properly sized thumbnail -- I get an image that  
looks the size of the whole new (cloned) group, and it's not a  
miniature of the big image, it's a crop of the big image. I can't  
remember how to miniaturize an imported snapshot down to thumbnail  
size. I know this has been discussed before but can't find it in the  
gmane archives. Any help appreciated.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list