Alvaro VS
Alvaro VS

Reputation: 203

Picture cropped when using display.save to store a photo with Corona SDK

I'm working on a small project to take pictures with Android devices, and then sending these files to a web server. The pictures are being taken without problems, but the "display.save" section is cropping the file to the size of the screen.

local function FotoTomada(event)
  if (event.completed == true) then
    display.save( event.target, "foto.jpg", {isFullResolution=true})
    SubirFoto()
  end
end

If my cell phone has a screen resolution of 480x500, that's the resolution the picture saved to a file is getting. Does anyone know of any workaround for this? Thanks in advance!

Upvotes: 0

Views: 225

Answers (2)

Amir
Amir

Reputation: 1683

Of course, that only saves the photo in your device resolution. Use this directly to save it to wherever you want:

local function onComplete( event ) local photo = event.target print( "photo w,h = " .. photo.width .. "," .. photo.height ) end

if media.hasSource( media.Camera ) then media.capturePhoto( { listener=onComplete } ) else native.showAlert( "Corona", "This device does not have a camera.", { "OK" } ) end

Upvotes: 0

Albert
Albert

Reputation: 161

You can provid the destination in media.capturePhoto( { listener, [, destination] } ) see CoronaDocs

Upvotes: 2

Related Questions