Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to rotate image?
Started by erik.g.haugen May 29 2015 10:42 PM

3 replies to this topic
image rotation image rotation display newimagerect
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

erik.g.haugen

[GLOBAL: userInfoPane.html]
erik.g.haugen
  • Observer

  • 4 posts
  • Corona SDK

Using display.newImageRect( ...) to display an image but I need to rotate landscape images.  How can I do this?

 

local bg = display.newImageRect( _G.whichImage, system.TemporaryDirectory, display.contentWidth,display.contentHeight)
 


[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,617 posts
  • Corona SDK

Not clear what you mean by 'rotate landscape image', but any display object can be rotated by changing the 'rotation' field:

bg.rotation = 45 -- rotate to 45 degrees


[TOPIC: post.html]
#3

erik.g.haugen

[GLOBAL: userInfoPane.html]
erik.g.haugen
  • Observer

  • 4 posts
  • Corona SDK

Thanks for the information!  Yes, this rotates the image.  Now I need to center the image and squeeze the image into the display dimensions.  How can I do this?



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,617 posts
  • Corona SDK


[topic_controls]
[/topic_controls]