Hi,
i try to take a snapshot using the built-in camera.
I use the sample of Developers Knowledge Base (
Livelink - Redirection)
but it not work.
The problem is that the Field viewfinder not work in not full size mode.
I try to load the sample on my blackberry bold and i can't view the viewfinder until i use displayFullSize().
The code is exactly the same of the downloaded sample and in the simulator work (but the simulator ask for a static image).
Anyone do this?
This is the code (i post only the code of field):
Code:
...
private MenuItem mi = new MenuItem("Viewfinder", 1, 1) {
public void run() {
try {
setupEncoding();
logField.setText("");
log("Active Encoding: "+encoding);
if(vc!=null){
UiApplication.getUiApplication().invokeLater(new Runnable(){
public void run(){
if(home.getFieldCount()<3){
home.delete(logField);
home.add(viewFinder);
home.add(logField);
viewFinder.setFocus();
}
}
});
vc.setVisible(true);
isViewfinderVisible=true;
log("Initialized ViewFinder");
}else {
log("VideoControl not initialized");
}
} catch (Throwable e) {
log(e + ":" + e.getMessage());
}
}
};
...
public SnapShotAPI(){
home = new MainScreen();
logField = new EditField("Log:","");
bitmapField = new BitmapField();
String[] choices = {"SuperFine 1600x1200", "Fine 1600x1200", "Normal 1600x1200", "SuperFine 1024x768", "Fine 1024x768", "Normal 1024x768", "SuperFine 640x480", "Fine 640x480", "Normal 640x480"};
qualityField = new ObjectChoiceField("Quality", choices);
home.add(qualityField);
home.add(logField);
home.addMenuItem(mi);
home.addMenuItem(mi1);
home.addMenuItem(mi2);
home.addMenuItem(mi3);
preview = new MainScreen();
preview.add(bitmapField);
pushScreen(home);
try{
p = Manager.createPlayer("capture://video");
p.realize();
log("Player realized");
p.prefetch();
log("Player prefetched");
p.start();
log("Player started");
vc = (VideoControl) p.getControl("VideoControl");
viewFinder = (Field)vc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
log("Initialized.");
} catch (Exception me){
log(me.getMessage());
}
isViewfinderVisible=false;
} Thank for help