使用CoronaActivity在Android上截取屏幕

我正在尝试通过CoronaActivity在Android中捕获屏幕,但没有成功。我不确定是否可能。

尝试过:

view = coronaActivity.getWindow().getDecorView().getRootView()
view.setDrawingCache(true)
view.compress(Bitmap.CompressFormat.PNG, 90, out)
...
点赞
用户825481
用户825481

只需像这样做:

local function saveImage(event)
    if (event.phase == "ended") then
      local hello = display.captureScreen(true)
      hello:removeSelf()
      local alert = native.showAlert( "Success", "屏幕截图已保存到相册", { "完成" } )
    end
end
2014-03-17 19:56:17