DDMS 屏幕截图与垂直同步不同步
我目前正在开发一款 Android 游戏,我想截取它的屏幕截图。 我使用 Eclipse 中的 DDMS 工具来完成此操作。然而,大多数屏幕截图都是两帧的混合:
___________
|new frame|
| |
| |
|_________|
|old frame|
| |
|_________|
分隔线位于不同的位置。
这让我得出这样的结论:屏幕截图是在当前帧仍在绘制时进行的。
有没有办法让屏幕截图与硬件同步?
是否有其他方法可以制作屏幕截图而不会发生这种情况?
预先感谢您的任何提示!
更新:请参阅我对解决方案已接受答案的最后评论。
I'm currently developing a game for Android and I want to take screenshots of it.
I did so using the DDMS tool in eclipse. However, most of the screenshots are a mix of two frames:
___________
|new frame|
| |
| |
|_________|
|old frame|
| |
|_________|
The separating line is in different positions.
This leads me to the conclusion that the screenshot is being made while the current frame is still being drawn.
Is there a way to get the screencap in sync with the hardware?
Are there other methods of making screenshots where this doesn't happen?
Thanks in advance for any hints!
Update: See my last comment on accepted answer for my solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这可能是一个蹩脚的解决方案,但它会是一个快速的解决方案。您能否(暂时、仅调试等)暂停游戏以便截取屏幕截图?又名“冻结”一帧时间?
I know this might be a crappy solution, but it would be a quick one. Can you (temporarily, debug only, etc.) have the game paused such that you can take the screenshots? Aka, "freeze" a single frame of time?
复杂的方式:
看看 vnc-server 应用程序。如果您的设备已获得 root 权限,则它可以显示摄像头视频流,而不会出现您所解释的问题。但它使用了大量的 jni 文件,并且仅仅为了截取一些屏幕截图而集成起来可能会很复杂。或者,您可以root您的设备,安装应用程序并在计算机上的vnc-client应用程序上拍摄快照。
https://github.com/oNaiPs/droid-VNC-server/tree/
市场上的应用程序:“org.onaips.vnc”
Complicate way:
Have a look at vnc-server app. If your device is rooted, it can display camera video flow without the problem you explain. But it uses a lot of jni file and could be complicated to integrate only to take some screenshot. Or you can root your device, install the application and take snapshot on your computer vnc-client application.
https://github.com/oNaiPs/droid-VNC-server/tree/
Application on market : "org.onaips.vnc"