here is my code…
I still use display.save() as I just need to upload to photo
– Camera not supported on simulator.
local isXcodeSimulator = “iPhone Simulator” == system.getInfo(“model”)
if (isXcodeSimulator) then
local alert = native.showAlert( “Information”, “Camera API not available on iOS Simulator.”, { “OK”})
end
–
local onComplete = function( event )
print( “Returned from camera view.” )
local photo = event.target
local baseDir = system.TemporaryDirectory
display.save(photo, “entireScreen.jpg”, baseDir )
photo.x = display.contentWidth/2
photo.y = display.contentHeight/2
photo.height= 340
photo.width= 230
screenGroup:insert(photo)
end
addcamera = function()
local ui = require(“ui”) --retake
local retake =function(event)
if event.phase ==“release” then
storyboard.gotoScene(“startmenu”,changeSceneEffectSetting)
storyboard.removeScene(“camera”)
end
end
local ui = require(“ui”) --upload
local upload =function(event)
if event.phase ==“release” then
— I want to add command here to upload to google image(and also wanna get the result photo name)
end
end
RETAKE = ui.newButton{
defaultSrc = “CoverButtoncopy.png”,
defaultX=232,
defaultY=68,
overSrc = “CoverButtoncopy.png”,
overX=232,
overY=68,
onEvent = retake,
text =“RETAKE”,
size = 40,
}
RETAKE.x = 160
RETAKE.y = 40
screenGroup:insert(RETAKE)
UPLOAD = ui.newButton{
defaultSrc = “CoverButtoncopy.png”,
defaultX=232,
defaultY=68,
overSrc = “CoverButtoncopy.png”,
overX=232,
overY=68,
onEvent = upload,
text =“UPLOAD”,
size = 40,
}
UPLOAD.x = 160
UPLOAD.y = 440
screenGroup:insert(UPLOAD)
end