Camera resolution, influence resolution

Hi,

First of all, according to the daily builds Android does have camera support - update the table?

Second, When I take a picture, do I just get the full picture full-res or can I influence the size of the picture taken? I know I can scale afterwards.

[import]uid: 5822 topic_id: 17671 reply_id: 317671[/import]

The Android device’s camera will take the image at full resolution, but it will be automatically downscaled when displayed in Corona to fit within the max texture size bounds required by OpenGL, which is typically 2048x2048. This is the same limitation imposed in the iOS version.

Also, make sure to set the CAMERA permission in your build.settings file, or else your app won’t have permission to use the camera. Please see the “media\camera” sample app included with the Corona SDK for an example. It’s build.settings file has already been updated for Android. We’ll update the API documentation when we get closer to releasing the next version of teh Corona SDK. [import]uid: 32256 topic_id: 17671 reply_id: 67660[/import]

OK, that’s all I needed to know. So the aspect ratio is always 1:1 as well (be sure to mention that in the docs!) [import]uid: 5822 topic_id: 17671 reply_id: 67665[/import]

Actually, the aspect ratio is not 1:1. The camera shot will be the aspect ratio set by the camera. Corona will shrink it down “proportionally” to fit within the max texture size bounds of 2048x2048. Odds are, either the length or height will be set to 2048 pixels and the other dimension will be set to something smaller. Does that make sense?

The one issue that you may run into compared to iOS is that the camera shot will not be automatically shrunk down to fit within the screen bounds on Android. That’s an outstanding issue that needs to be fixed on the Corona side of things. It’s not a major issue because you can re-scale it for yourself, but it is a difference in behavior. [import]uid: 32256 topic_id: 17671 reply_id: 67787[/import]

Is there a way to change the resolution of the camera in Android. I scale to fit my images to a box of 300X400 and iphone fits perfectly. Android on the other hand has a default camera resolution of Wide (16:9) resolution and this causes ugly clipping. Is there  a way to change it to Normal mode (4:3)?

Not that I’m aware of.  But you can scale down the resulting photo to fit the screen like this…

-- Downscale the photo fit the screen letterbox with margin. local xScale = display.contentWidth / myPhoto.contentWidth local yScale = display.contentHeight / myPhoto.contentHeight local scale = math.max(xScale, yScale) \* 0.75 -- The 0.75 part adds a % margin. myPhoto:scale(scale, scale) -- Move the photo to the center of the screen. myPhoto.x = display.contentCenterX myPhoto.y = display.contentCenterY

Is there a way to change the resolution of the camera in Android. I scale to fit my images to a box of 300X400 and iphone fits perfectly. Android on the other hand has a default camera resolution of Wide (16:9) resolution and this causes ugly clipping. Is there  a way to change it to Normal mode (4:3)?

Not that I’m aware of.  But you can scale down the resulting photo to fit the screen like this…

-- Downscale the photo fit the screen letterbox with margin. local xScale = display.contentWidth / myPhoto.contentWidth local yScale = display.contentHeight / myPhoto.contentHeight local scale = math.max(xScale, yScale) \* 0.75 -- The 0.75 part adds a % margin. myPhoto:scale(scale, scale) -- Move the photo to the center of the screen. myPhoto.x = display.contentCenterX myPhoto.y = display.contentCenterY