image processing
Posted: Thu Mar 22, 2012 4:03 pm
Pardon the newbie question. I struggle with the sparse documentation in the area, or maybe I haven't found it yet. I wonder if someone here can kick me into the right direction, so here's what I hope to accomplish:
1. import an image, but do not show it
2. create a copy of that image
3. cut a specific rectangle from that image
4. assign the snippet to a button's icon
Following is a little tester that I wrote:
I can now see the new image on the card, not as a skin on button "b1". Image "skin" appears at the location specified by the rectangle, but the crop appears to be taken from the centre of the source image.
Suggestions and pointers will be much appreciated.
1. import an image, but do not show it
2. create a copy of that image
3. cut a specific rectangle from that image
4. assign the snippet to a button's icon
Following is a little tester that I wrote:
Code: Select all
on mouseUp
put the width of button "b1" into w
put the height of button "b1" into h
create image "skin"
put image "test.jpg" into image "skin"
crop image "skin" to 50, 50, 50+w, 50+h
-- future: manipulate image "skin" further (apply gloss and reflection effects)
set the icon of button "b1" to image "skin"
end mouseUp
Suggestions and pointers will be much appreciated.