can't resize an image that has been rotated?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
can't resize an image that has been rotated?
This came from experimenting with a thread:
https://forums.livecode.com/viewtopic.php?f=7&t=37985
Anyway, if one imports an image onto a card and then sets its angle to some value, that image can no longer be resized.
Just me again?
Craig
https://forums.livecode.com/viewtopic.php?f=7&t=37985
Anyway, if one imports an image onto a card and then sets its angle to some value, that image can no longer be resized.
Just me again?
Craig
Re: can't resize an image that has been rotated?
Hi Craig,
I can resize a rotated image here (LC9.6.9, Win10) by changing the height and/or width using the Property Inspector or the Message Box.
I would note that rotating an image automatically changes the image dimensions.
Cheers,
Rob
I can resize a rotated image here (LC9.6.9, Win10) by changing the height and/or width using the Property Inspector or the Message Box.
I would note that rotating an image automatically changes the image dimensions.
Cheers,
Rob
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
I used ROTATE, and NOT set the angle.
Image NOT locked.
- -
Xubuntu Linux as MacOS 14 developer beta hoses LiveCode.
Code: Select all
on mouseUp
rotate img "cat" by 45
set the width of img "cat" to 400
set the height of img "cat" to 400
end mouseUp
- -
Xubuntu Linux as MacOS 14 developer beta hoses LiveCode.
Re: can't resize an image that has been rotated?
Hi.
I was unclear. One cannot resize with the pointer tool in edit mode. All the programmatic methods do indeed work.
Craig
I was unclear. One cannot resize with the pointer tool in edit mode. All the programmatic methods do indeed work.
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
This:
did NOT work!
- -
MacOS 10.7.5 , LC 8.1.10
Code: Select all
on mouseUp
set the angle of img "cat" to 45
set the width of img "cat" to 400
set the height of img "cat" to 400
end mouseUp
- -
MacOS 10.7.5 , LC 8.1.10
Re: can't resize an image that has been rotated?
Hmmm.
My original point was this. If one imports an image file then selects the pointer tool, one can resize the image by hand. If however, one sets the angle of that image to some value, one can no longer resize with the pointer tool. No other properties have been changed by simply setting the angle (I think).
That these commands do not work on an image whose angle is not 0 is odd. Oddly, if one resets the angle back to "0", all of those other things work.
Craig
My original point was this. If one imports an image file then selects the pointer tool, one can resize the image by hand. If however, one sets the angle of that image to some value, one can no longer resize with the pointer tool. No other properties have been changed by simply setting the angle (I think).
That these commands do not work on an image whose angle is not 0 is odd. Oddly, if one resets the angle back to "0", all of those other things work.
Craig
Re: can't resize an image that has been rotated?
Craig,dunbarx wrote: ↑Thu Jun 22, 2023 1:35 pmMy original point was this. If one imports an image file then selects the pointer tool, one can resize the image by hand. If however, one sets the angle of that image to some value, one can no longer resize with the pointer tool. No other properties have been changed by simply setting the angle (I think).
That these commands do not work on an image whose angle is not 0 is odd. Oddly, if one resets the angle back to "0", all of those other things work.
At first I did not understand what you were describing and now I see the same behavior you mention.
However I think it is more a documentation omission not to mention that fact than a bug. I think it is actually a feature. Because once you set the angle of an image (via message box or Properties Inspector or code) you would change that angle when manually changing the image dimensions with the pointer tool.
Kind regards
Bernd
Re: can't resize an image that has been rotated?
To see the ROTATE command in action try this as script of a scrollbar
Code: Select all
on scrollbarDrag pValue
rotate image "cat" by pValue
end scrollbarDrag
Poor cat...
(It is mentioned in the dictionary)
Kind regards
Bernd
Re: can't resize an image that has been rotated?
@Richmond. Yes, setting the angle of an image does not have the distortion issues that rotating does. As Bernd said, the dictionary warns about this.
@Bernd. Changing the width or height of an image distorts that image in the "usual" way. If the image shows an object "pictured" at some angle, it does not change the "angle" of the image itself, though it might look like it does. It just distorts it as usual, and the image does the best it can.
I agree this appears to have been locked on purpose, but I really do not see why. If one changes the width and height of an image in its proper proportion, one gets an accurate smaller version of that image. This might be desirable. Surely one can set those properties before setting the angle, but I still don't see the benefit of closing that option down.
Craig
@Bernd. Changing the width or height of an image distorts that image in the "usual" way. If the image shows an object "pictured" at some angle, it does not change the "angle" of the image itself, though it might look like it does. It just distorts it as usual, and the image does the best it can.
I agree this appears to have been locked on purpose, but I really do not see why. If one changes the width and height of an image in its proper proportion, one gets an accurate smaller version of that image. This might be desirable. Surely one can set those properties before setting the angle, but I still don't see the benefit of closing that option down.
Craig
Re: can't resize an image that has been rotated?
When setting a new width and height of an imported image, the lockLoc must be set to true before changing the angle, or the original imported rect will be restored. Again, I do not see how this prevents unwanted behavior.
This setting of the lockLoc is essential if one wants to prevent LC from restoring the original imported rect after messing around with that image in some way. For example, if one imports an image and then changes its rect, if that image is then duplicated, the copy will be at the original rect.
Never mind setting angles, this general behavior was considered by the LC developers early on, and dealt with they way they did.
I invariably set the lockLoc immediately after importing any image.
Craig
This setting of the lockLoc is essential if one wants to prevent LC from restoring the original imported rect after messing around with that image in some way. For example, if one imports an image and then changes its rect, if that image is then duplicated, the copy will be at the original rect.
Never mind setting angles, this general behavior was considered by the LC developers early on, and dealt with they way they did.
I invariably set the lockLoc immediately after importing any image.
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
Indeed: rapid degradation of the image.Poor cat...
Something that a fair few of us knew about about 20 years ago.
BUT, surely that is not the thing we are considering.
What we are considering (well, at least last time I looked) was how to resize, using code,
an image that had been rotated in either of the 2 ways offered by LiveCode.
As rotate chews images like a T-Rex gobbled up a small, vegetarian dinosaur,
and images rotated using set the angle don't seem to be capable of being resized,
if I were wanting to do this on a semi-fulltime basis I would hunt around for a way to do
this outwith LiveCode [GIMP springs to mind].
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
THIS is my 'Quick-n-Dirty' way of doing things:
-
-
Still a bit . . .
- -
round the edges.
Code: Select all
on mouseUp
set the angle of img "cat" to 45
import snapshot from img "cat"
delete img "cat"
set the name of the last img to "cat"
set the width of img "cat" to 400
set the height of img "cat" to 400
end mouseUp
Still a bit . . .
- -
round the edges.

-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
When I imported an SVG image into 9.6.3 and the did this:
The ONLY reason the image went 'all fuzzy' was because I was stupid enough to import and image which the internet supplier
described as an SVG, BUT was NOT drawn with vector graphics, just a bitmapped image inside an SVG wrapper.
-
Code: Select all
rotate img "scarab" by 45
set the width of img "scarab" to 482
set the height of img "scarab" to 560
described as an SVG, BUT was NOT drawn with vector graphics, just a bitmapped image inside an SVG wrapper.
-
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
AND here, with what is, supposedly, a vector SVG, is a complete load of rubbish:
-
Code: Select all
on mouseUp
rotate img "beetle" by 45
set the width of img "beetle" to 450
set the height of img "beetle" to 450
set the top of img "beetle" to 300
end mouseUp
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: can't resize an image that has been rotated?
I wonder if this means that LC on performing a rotate on an imported SVG image converts it into a bitmapped image?