Page 1 of 1

Rotate photo in Android

Posted: Tue Oct 16, 2012 3:00 pm
by cusingerBUSCw5N
Hi. I have learned that Androids take pictures using landscape. My app uses portrait layout.

I can deal with taking a picture using landscape, but when I bring it into the app, it displays sideways. I want to rotate it so it looks OK on the app.

I tried looking at revRotatePoly - but it it not for mobile applications.

How do I rotate an image 90 degress on an Android?

Thank you.

Re: Rotate photo in Android

Posted: Tue Oct 16, 2012 3:07 pm
by Klaus
Hi cusingerBUSCw5N,

...
set the angle of img "xyz" to 90
...


Best

Klaus

Re: Rotate photo in Android

Posted: Tue Oct 16, 2012 3:09 pm
by cusingerBUSCw5N
sorry - I didn't realize that the simple command rotate worked in android. As usual, I was looking for a more complex solution.

Re: Rotate photo in Android

Posted: Tue Oct 16, 2012 3:22 pm
by cusingerBUSCw5N
mobile didn't work.

Thank you Klaus - as usual, you are right on...
except, it needs to be -90

set the angle of image "libImage" to -90

does the trick

Re: Rotate photo in Android

Posted: Tue Oct 16, 2012 3:30 pm
by Klaus
Hi cusingerBUSCw5N,
cusingerBUSCw5N wrote:mobile didn't work.
yep, "rotate" is more an "image editing" command, since it is destructive and will really ROTATE the complete image!
Setting the "angle" is non-destructive.
cusingerBUSCw5N wrote:except, it needs to be -90
Hey, but you didn't specify a direction! :lol:


Best

Klaus

Re: Rotate photo in Android

Posted: Sat Nov 09, 2013 2:26 pm
by Mag
Thank Klaus for this post. I'm using it but having I resize the image by a scale factor that get to have the image at (a sort of) full screen, when then I rotate it, it keeps the original (big) size. Any advice? :(

Code: Select all

   put (the width of image myImage/the width of this card) into resizeFactor -- (for example 5.4)
   set the width of image myImage to the width of image myImage / resizeFactor
   set the height of image myImage to the height of image myImage / resizeFactor
   
   if the platform is "android" then
      set the angle of image nomeImmagine to -90
   end if
   
   set the loc of image myImage to the loc of this card

Re: Rotate photo in Android

Posted: Sat Nov 09, 2013 3:35 pm
by Klaus
Hi Mag,

sorry, what is happening with the rect and widht and height of an image
when its angle <> 0 is still a complete mistery to me, so I avoid that :D


Best

Klaus

Re: Rotate photo in Android

Posted: Sat Nov 09, 2013 6:46 pm
by Mag
:D

Just replace all the above with:

Code: Select all

   if the platform is "android" then
      set the angle of image myImage to -90
   end if
And just used an image control with the correct sizes and its lockloc set to true 8)