Image sizing a problem...

Jim Carwardine JimCarwardine at OwnYourFuture-net.com
Thu Nov 18 12:03:06 EST 2004


Hi Folks... I'm still going nuts trying to figure out the nuances of images.
The docs say that when you put an image into an image container, the image
contain takes the rect of the image as it's own rect.  I'm creating a
thumbnail of an image and setting the icon of a button to the thumbnail
image.  The icon keeps reverting back to the original image size, thus only
showing a small portion of the image.  So I used a temp image to resize the
image them put the resized image into the image I want to set the icon to.
The receiving image doesn't resize.

Here's the script...

    set the showName of button whatPosition to false
  set the style of button whatPosition to transparent
  put 43 into theTargetSize
  if there is not an image whatPosition then create image whatPosition
  if there is not an image "tempImage" then create image "tempImage"
  hide image "tempImage"
  hide image whatPosition
  put gGraphImg into image "tempImage"
  put theTargetSize/the formattedwidth of image "tempImage" into theRatio
  set the width of image "tempImage" to theTargetSize
  set the height of image "tempImage" to \
      round(the formattedheight of image "tempImage" * theRatio)
  if the height of image "tempImage"> 25 then set the height of image
"tempImage" to 25

  put image "tempImage" into image whatPosition

  answer the height of image whatPosition -- **** displays the size of the
orignal image
  
  set the lockLoc of image whatPosition to true
  set the icon of button whatPosition to the short id of image whatPosition
  

I¹m really having trouble wrapping my head around this ³slight of image²
stuff I¹m experienceing.  I know it¹s newby stuff but I¹d like and expect
the learning curve to be MUCH quicker.  Is there any definitive, contiguous
discussion of images?

I¹m finding that the docs are very disjointed and I don¹t know what I don¹t
know so I can¹t look up the appropriate docs.  Search doesn¹t seem to very
helpful... Jim

-- 

OYF is... Highly resourceful people working together.
<http://www.OwnYourFuture-net.com>

Own Your Future Consulting Services Limited,
1959 Upper Water Street, Suite 407, Halifax, Nova Scotia. B3J 3N2
Info Line: 902-823-2477, Phone: 902-823-2339. Fax: 902-823-2139





More information about the use-livecode mailing list