BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-05-2009, 02:54 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem to take a snapshot using the built-in camera

Please Login to Remove!

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
Offline  
Old 07-05-2009, 03:18 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi, sorry for repeated question:
I just find this that explain that it not work on 8900 Curve.
Camerademo does not work on 8900 Curve - Java Development - BlackBerry Support Community Forums

I post it for future askers ;)

Bye
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.