当屏幕不在显示堆栈上时,如何截取屏幕截图?黑莓
我想要将屏幕从 my_screen1 转换到 my_screen2。想法是截取两个屏幕的屏幕截图,并使用动画从 1 过渡到 2。然后将 my_screen2 推送到显示堆栈上。但是,在将屏幕 my_screen2 推入显示堆栈之前,我可以截取它吗? 代码:
Display.screenshot(bitmap);
给出已经显示的屏幕截图。有类似的东西吗:
my_screen2.screenshot(bitmap);
请问有示例代码吗?多谢!
I want to make screen transition from my_screen1 to my_screen2. Idea is to take screenshot of both screens, and with animation to transit from 1 to 2. And then to push my_screen2 on display stack. But can I take screenshot of screen my_screen2 before I push it on display stack?
the code:
Display.screenshot(bitmap);
gives screenshot of screen which is already on display. Is there something like:
my_screen2.screenshot(bitmap);
Any example code please? Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法对不在显示堆栈上或位于特定屏幕下方的屏幕进行屏幕截图。文档说
Display.screenshot()
获取整个屏幕的屏幕截图并将其保存到位图中。如果您想要从一个屏幕过渡动画屏幕到另一个屏幕时,您可以执行以下操作。
You cannot take screenshot of a screen which is not on the display stack ,or which is below a particular screen. The docs say that
Display.screenshot()
Takes a screenshot of the entire screen and saves it into a Bitmap.If you want to have a screen transition animation to go from one screen to another, you can do the following.
请参阅 rahul_narkhede 提供的有关 OS5 之前的滑动屏幕转换的解决方案,我过去曾成功使用过它。
http://supportforums.blackberry .com/t5/Java-Development/Animated-Screen-transitions/td-p/162521/page/6
See this solution by rahul_narkhede for pre-OS5 Sliding Screen Transitions, I have used it successfully in the past.
http://supportforums.blackberry.com/t5/Java-Development/Animated-Screen-transitions/td-p/162521/page/6