09-17-2012 02:11 AM
I am using below code to take screenshot of Blackberry.
public static Bitmap getScreenShot() {
Bitmap bitmap;
bitmap = new Bitmap(Display.getWidth(), Display.getHeight());
Display.screenshot(bitmap);
try {
FileConnection file = (FileConnection)Connector.open("file:///store/home
if(!file.exists()){
file.create();
}
DataOutputStream out = file.openDataOutputStream();
out.write(getBytesFromBitmap()); //returns bytes from the bitmap object
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return bmp;
}
I want to convert this Bitmap object to a file of any file format: .bmp/.png/.jpg etc. Is there any way I can achieve this?
Please help.
Thanks.
Solved! Go to Solution.
09-17-2012 02:57 AM
solved this..i was not closing my outputstream.. ![]()