scaling an image only works when angle is near 0?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
scaling an image only works when angle is near 0?
Hi All,
I was having a look at multi-touch, and ran across something strange:
Setting the width and height of an image only seems to have an effect when the angle of the image is 0.
Can that be right? I can image a *very* long way around this by cloning the image, scaling the new image, and then rotating that, but that seems extravagantly wasteful.
-Ken
P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?
I was having a look at multi-touch, and ran across something strange:
Setting the width and height of an image only seems to have an effect when the angle of the image is 0.
Can that be right? I can image a *very* long way around this by cloning the image, scaling the new image, and then rotating that, but that seems extravagantly wasteful.
-Ken
P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: scaling an image only works when angle is near 0?
Ken-P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?
One of the weirder parts of the language. Check out the "rotate" command for images instead of setting the angle.
Re: scaling an image only works when angle is near 0?
For rotating graphics look at revrotatepoly. It works nicely though there are a couple quirks. If you rotate the poly repeatedly, due to the necessity to truncate the pointlist for the grc (you can't have a point at 1.235,35.434 pixels) this can cause the poly to eventually rotate itself down smaller and smaller. While its probably not the BEST way, I got around this by simply storing the initial point list then on each iteration reset the grc points list back to the start setting and rotate from there.
There is probably something here i'm missing of course that would make it easier, but as it is its pretty workable.
There is probably something here i'm missing of course that would make it easier, but as it is its pretty workable.
kcorey wrote:
P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?
Re: scaling an image only works when angle is near 0?
Ah, that works for lines, curves, or irregular polygons. What about rect? rounded rect?, oval?
I think the thing I find most frustrating with runrev is the sheer chaotic nature of the interfaces.
-Ken
I think the thing I find most frustrating with runrev is the sheer chaotic nature of the interfaces.
-Ken
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: scaling an image only works when angle is near 0?
Hi Ken,
here is an example of scaling and turning an image at the same time. It is not rotate/enlarge multitouch iOS but might give you some ideas.
http://forums.runrev.com/phpBB2/viewtop ... 042#p37952
see the thread for context.
Kind regards
Bernd
here is an example of scaling and turning an image at the same time. It is not rotate/enlarge multitouch iOS but might give you some ideas.
http://forums.runrev.com/phpBB2/viewtop ... 042#p37952
see the thread for context.
Kind regards
Bernd
Re: scaling an image only works when angle is near 0?
The thing causing the trouble was the 'lock size & position' checkbox.
If this is not checked, then sizing only happens when the angle is 0.
If this is checked, then sizing and rotation can happen at the same time.
Seems backwards, but there it is.
-Ken
If this is not checked, then sizing only happens when the angle is 0.
If this is checked, then sizing and rotation can happen at the same time.
Seems backwards, but there it is.
-Ken