Page 1 of 1

Taking advantage of the orientation of the device

Posted: Tue Dec 10, 2013 2:36 pm
by Mag
Hi all,

I'm trying to adapt an image to take advantage of the new orientation of the device. This code works fine, but in portrait mode it crops the image at the left and right side. Any suggestion to improve it? :oops:

Code: Select all

on adaptImage
   set the width of image myImage to the width of this card
   put (formattedWidth of image myImage/the width of image myImage) into myFactor
   set the height of image myImage to (the the formattedHeight of image myImage/myFactor)
   
   set the loc of image myImage to the loc of this card
end adaptImage

Re: Taking advantage of the orientation of the device

Posted: Wed Dec 11, 2013 12:02 am
by Simon
Hi Mag,
Doubt this is the problem but you have a repeated word:
to (the the formattedHeight

A
bird
in the
the hand

That's some kind of optical illusion.

What happens if you stop the code right after;
set the width of image myImage to the width of this card
Does that do it's job correctly?

Simon

Re: Taking advantage of the orientation of the device

Posted: Sat Dec 14, 2013 2:02 pm
by Mag
Thank you Simon. Sorry, it is an error I done in the simplified version of the code I made for the forum :oops: