Changing image size don't work when the angle is not 0

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Changing image size don't work when the angle is not 0

Post by Mag » Sun Nov 17, 2013 2:00 am

Hi all,

I'm trying to resize an image after i set it's angle (it's for when the orientation on mobile is changed), but it's seems to me that the new width and eight has effect only when the image is not "rotate". Ideas? :?: :idea:

Code: Select all

on mouseUp
   set the angle of image 1 to the angle of image 1 + "90"
   set the height of image 1 to 100
   set the width of image 1 to 100
   set the loc of image 1 to the loc of this card
end mouseUp
Attachments
Untitled 1.livecode.zip
(91.84 KiB) Downloaded 157 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Changing image size don't work when the angle is not 0

Post by Simon » Sun Nov 17, 2013 3:25 am

Hi Mag,
Not sure you have to do this.
When the mobile rotates "top" becomes the new top of the device.. errr
the width and height of your card changes on orientation change .. errr
the left of the stack is always in your left hand?

Ok ok you just need that set the loc. Not the rotation as it still sees the top of the stack as the top of the device.

more: You'll have to work with resizeStack to work out the dimensions of the image you want (maybe 6.5 resolution independence you don't have to), make it wider in landscape etc.

I think I'm not getting the question right. :oops:

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Changing image size don't work when the angle is not 0

Post by Mag » Sun Nov 17, 2013 8:24 pm

Hi Simon, thank you for your post and useful info. I post an image when you can see the problem.


PS
I need to resize the image because I'm creating a Gallery of photos. So it's important that the image is rotated within the device and resized.
Attachments
orient.png

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Changing image size don't work when the angle is not 0

Post by Simon » Sun Nov 17, 2013 8:45 pm

Hi Mag,
Which version of liveCode are you using?
Oh Wait!

Have you setup your "allowed orientations"?
put mobileOrientation() --should contain landscape

http://lessons.runrev.com/s/lessons/m/4 ... ientations

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Changing image size don't work when the angle is not 0

Post by Mag » Sun Nov 17, 2013 10:16 pm

Thank you very much Simon! I had not thought of doing this because I was hoping to make only a card adjustable and not the entire stack which is made of many different sections. But I'll go with your solution, in the end, however, I have to make the stack resizable depending on the device then, there is not much more work.

Post Reply