Hey guys when I use display.svave on android to save an image and upload it my server, i constantly get a black or clear image with no data in it.
Here is my code:
[lua]
– Completion listener
local function onComplete(event)
local photo = event.target
local saveGroup = display.newGroup()
saveGroup:insert( photo )
– Save the photo into the temporary directory
display.save( saveGroup,‘1.png’, system.TemporaryDirectory )
photo:removeSelf()
local r = display.newImageRect(‘1.png’, system.TemporaryDirectory,100,100)
r.x = display.contentWidth/2
r.y = display.contentHeight/2
end
– Button tap listener
local function pickPhoto( event )
– Note: Only use one of the media.show routines listed below
– Save photo to file in Temporary directory
--media.capturePhoto( {listener = onComplete, destination = {baseDir=system.TemporaryDirectory, filename=“image.jpg”, type=“image”} } )
– Show photo on screen (no file save)
media.capturePhoto( {listener = onComplete } )
end
local button = display.newRect(120,240,80,70)
button:addEventListener(“tap”, pickPhoto )
[/lua]
Any one encounter this before?
Thanks.