What I am trying to do is add images to a group when someone clicks a button. These images don’t exist in the stack - they are created programatically. Then what happens is that they are rotated and scaled, and this is where the problem arises. Setting the width and height does not work.
Here’s some edited highlights of my code:
Code: Select all
put random( 20 ) - 10 into myAngle
create img in group "cluster" of card "main card"
put the id of it into myImageID
put it into thumbnailImage – doing this as eventually, I’ll be creating a second image in another stack, and I’ll want to reference either at this point
-- storing the ID in an array for future reference
put myImageID into imagesArray[imagesCounter]
put imagesCounter + 1 into imagesCounter
set the loc of thumbnailImage to 300,300
set the showborder of thumbnailImage to false
-- Make the image look like something, using an externally referenced file
put myAppPath & "/label1.png" into myLabelImage
set the text of thumbnailImage to URL ("binfile:" & myLabelImage)
set the visible of thumbnailImage to true
set the loc of thumbnailImage to 300,300
set the showborder of thumbnailImage to false
set the angle of thumbnailImage to 0
set the width of thumbnailImage to the formattedWidth of thumbnailImage
set the height of thumbnailImage to the formattedHeight of thumbnailImage
-- StickerScale is a variable calculated elsewhere. This ensures that the created image is the right size in the main window (which is a preview)
put 1000 * stickerScale into myWidth
put 644 * stickerScale into myHeight
-- myAngle is a random number created elsewhere
set the angle of thumbnailImage to myAngle
-- These do not work
set the width of thumbnailImage to myWidth
set the height of thumbnailImage to myHeight