Image sizing a problem...
JimCarwardine at OwnYourFuture-net.com
Thu Nov 18 14:27:48 EST 2004
Thanks, Jim. I tried what you suggested and got two anomalies - first image
whatPosition was still the large size and it and the icon of the button were
both totally black... Jim
Here is my modified 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 whatPosition
hide image "tempImage"
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 the imageData of image "tempImage" into tempResizedImage
set the imageData of image whatPosition to tempResizedImage
set the icon of button whatPosition to the short id of image whatPosition
on 11/18/04 1:33 PM, Jim MacConnell wrote:
> I ran into the same thing long ago.. And haven't gotten back to it as other
> priorities have taken hold ($$) but.
> Look at the imageData property. Use it when you want to capture a
> "processed" image.
>> From 2.2. docs:
> = = = = = = = = = = = =
> The imageData, unlike the contents of the image container, is based on the
> picture as it's presented on the screen, not stored in the image object.
> This means that if you resize an image, the content of the image does not
> change, but its imageData does. If you create an image and then reduce its
> size, its imageData reflects the scaled-down, displayed image, not the
> original full-scale image. If you create a second image and set its
> imageData property to the imageData of the original image, resizing the
> first image back to the original dimensions displays the original image at
> full resolution, but resizing the second image does not, because setting its
> imageData transferred only the scaled-down version of the original.
> Tip: To copy the information in an image at full resolution, regardless
> of whether its height and width have been changed, use a statement like the
> put image "Full Resolution" into image "Copied Image"
> = = = = = = = = =
> So try
> Put the imageData of image "tempImage" into shouldLookLike
> set the imageData of image whatposition to shouldLookLike
> Hope this helps.
> (another newbie)
> use-revolution mailing list
> use-revolution at lists.runrev.com
OYF is... Highly resourceful people working together.
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