[英]Capture screen using CoronaActivity in Android
I'm trying to capture screen in Android through CoronaActivity but without success. 我正在尝试通过CoronaActivity在Android中捕获屏幕,但没有成功。 I'm not sure whether this is possible at all.
我不确定这是否可能。
tried: 尝试过:
view = coronaActivity.getWindow().getDecorView().getRootView()
view.setDrawingCache(true)
view.compress(Bitmap.CompressFormat.PNG, 90, out)
...
Just do something like this: 只是做这样的事情:
local function saveImage(event)
if(event.phase=="ended") then
local hello = display.captureScreen(true)
hello:removeSelf()
local alert = native.showAlert( "Success", "Screen Capture Saved to Gallery", { "Done" } )
end
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.