BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   capture image programmatically (http://www.blackberryforums.com/developer-forum/259484-capture-image-programmatically.html)

janaknayangaljanak 05-15-2012 05:26 AM

capture image programmatically
 
hello

i am trying to capture an image using a background thread without open any screen.....

using following code this code is working fine but i want to do all process in a background thread:

cameraPlayer = Manager
.createPlayer("capture://video?encoding=jpeg");
cameraPlayer.start();
// cameraPlayer.realize();
videoControl = (VideoControl) cameraPlayer
.getControl("VideoControl");
_videoField = (Field) videoControl.initDisplayMode(VideoControl.USE_GUI_ PRIMITIVE,
"net.rim.device.api.ui.Field");
add(_videoField);

Thread.sleep(1000);
String encoding = null;
if (_encodings != null) {
// Use the user-selected encoding instead.
encoding = _encodings[1].getFullEncoding();
}
byte[] imageByte = videoControl.getSnapshot(encoding);




Thanx


All times are GMT -5. The time now is 07:19 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.