Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 22
Registered: ‎08-22-2008
My Device: Bold
Accepted Solution

Copy a screenshot into a Bitmap does not work on a device

I developed a program that creates a Bitmap and copys a screenshot in it.

This runs on the 8820 Simulator but not on 8820 Firmware 4.5.0.37.

It throws exception on device. I think I need to find out what kind of Bitmap needs to be created before performing the Screenshot. THere is a Bitmap Constuctor with a type parameter. Do I need to use it for creating the correct Bitmap?

 

Here the Screenshot Code:

Bitmap theBitMap = new Bitmap(Display.getWidth(), Display.getHeight());
Display.screenshot(theBitMap);

Thank you Juergen

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Copy a screenshot into a Bitmap does not work on a device

What exception are you receiving?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Copy a screenshot into a Bitmap does not work on a device

[ Edited ]
What are the dimensions of the image you are trying to draw?
Message Edited by mreed on 08-28-2008 09:36 AM
Developer
Posts: 22
Registered: ‎08-22-2008
My Device: Bold

Re: Copy a screenshot into a Bitmap does not work on a device

I rebooted the BlackBerry, removed and reinstalled the application.

Then the Exception is gone so the problem just disapeared by magic.