01-06-2010, 06:28 AM
|
#1 (permalink)
|
Thumbs Must Hurt
Join Date: Mar 2007 Location: India Model: 8100 Carrier: Airtel
Posts: 64
Post Thanks: 0 Thanked 0 Times in 0 Posts
| Display.screenshot(Bitmap) returns blank screen Please Login to Remove! Hello All,
I am developing an application which uses camera (VideoControl and Player).
Here I am pasting my code
String encoding = "encoding=video/3gpp&mode=standard";
_player = Manager.createPlayer("capture://video?"+encoding);
_player.realize();
_videoControl = (VideoControl)_player.getControl("VideoControl");
if(_videoControl != null){
Field videoField = (Field) _videoControl.initDisplayMode(VideoControl.USE_GUI _PRIMITIVE, "net.rim.device.api.ui.Field");
add(videoField);
btnStart = new ButtonField("Get Snap", ButtonField.CONSUME_CLICK | ButtonField.FIELD_HCENTER);
add(btnStart);
_videoControl.setVisible(true);
btnStart.setChangeListener(this);
_player.start();
}
On click event of a buutonField btnStart I am calling this
public void fieldChanged(Field field, int x) {
Bitmap bmp = null;
VerticalFieldManager vfmMain = new VerticalFieldManager(
VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
while (snapCounter < 20) {
bmp = new Bitmap(Display.getWidth(), Display.getHeight());
Display.screenshot(bmp);
vfmMain.add(new BitmapField(bmp));
bmp = null;
snapCounter++;
Thread.sleep(100);
}
}
he bitmap I get includes the pictures seen in the camera too.
But this works for fine when i launch application for the first tiem after installing it in device. When I exit application and again launch it it gives screen but without any camera pictures. I want the image with the camera pictures.
Please anybody knows why it is happening. And Is there any solution for this.
Thanks
__________________
Crazy for BlackBerry
Last edited by renuka_anil : 01-06-2010 at 08:10 AM.
Reason: pasted code snippet
|
Offline
| |