Taking screenshot of the current screen in BlackBerry

不羁岁月 提交于 2020-01-03 20:57:29

问题


Is it possible to take a screenshot of the current screen in a BlackBerry Application? I have a button in my screen, when I click the button I want to send an email with the screenshot of the current screen.


回答1:


You can use the following method to get a screenshot of the displayed screen

public static Bitmap getScreenShot() {
    // get the current screen .
    Bitmap bitmap;
    bitmap = new Bitmap(Display.getWidth(), Display.getHeight());
    Display.screenshot(bitmap);
    // return the screen shot
    return bitmap;
}



回答2:


You can take a screenshot by calling Display.screenshot(aBitmap), passing a Bitmap of the right size. There's also a version of the method that can take a screenshot of a part of the screen.



来源:https://stackoverflow.com/questions/8891618/taking-screenshot-of-the-current-screen-in-blackberry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!