问题
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