我可以使用此代码拍照:规模拍摄的照片,以屏幕尺寸
local centerX = display.contentCenterX
local centerY = display.contentCenterY
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 sessionComplete = function(event)
local image = event.target
if image then
image.x = centerX
image.y = centerY
local w = image.width
local h = image.height
end
end
local listener = function(event)
if media.hasSource(media.Camera) then
media.capturePhoto({ listener = sessionComplete })
else
native.showAlert("Corona", "Camera not found.")
end
return true
end
trigger:addEventListener("tap", listener)
但如果画面是大不缩小或缩小,我已经试过当地W = display.contentWidth但没有任何事情发生。我如何将照片缩放到精确的屏幕尺寸,可能需要在Y轴上缩放以填满屏幕