making a thumbnail from a snapshot

Peter Brigham MD pmbrig at gmail.com
Mon Feb 15 09:20:03 EST 2010


David & Ken --

Thanks for your assistance. It was failing to lock the size/loc of the  
new image that was tripping me up.

-- Peter

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


On Feb 14, 2010, at 1:13 PM, David Bovill wrote:

> Just from memory - you need to set the rect of the image to the nuew
> thumbnail size and let rev do the scaling for you... then you can  
> get the
> imagedata which returns the scaled image data and set the imagedata  
> (ie set
> the imagedata of image "thumbnai"l to the imagedata of image  
> "thumbnail")
>
> But looking at your script - I don;t think you need to do any of  
> that - you
> just need to:
>
> put image "mDisplay" of stack "dispStack" into img "mThumb" of group
> newGpName of stack ".....
>
> and make sure the thumbnail image has its location locked. Then you  
> can:
>
> set the imagedata of image "thumbnail" to the imagedata of image  
> "thumbnail"
>
> if you want to scale down the new image size.
>
> On 13 February 2010 23:03, Peter Brigham MD <pmbrig at gmail.com> wrote:
>
>> 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 <http://home.comcast.net/%7Epmbrig>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list