Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® Bold™

Reply
Regular Visitor
notmaxx
Posts: 1
Registered: ‎11-12-2008
My Device: Not Specified

Viewfinder resize on 4.6 & 4.7 (Bold & Storm)

Hi,  
I ran camera demo from JDE 4.6.
It shows viewfinder but I didn't find out how to control its size, by
default it is 240*180, _videoControl.setDisplaySize(width, height) throws exception "not supported". Only the way to change it is to set full screen mode.
I tried on Bold simulator and real device. aThe same for JDE 4.7 and Blackberry Storm simulator. 
 
Do you have any ideas how to control viewfinder size? 
 
Below is code from the camera demo:
 
    private void initializeCamera()
    {
        try
        {
            //Create a player for the Blackberry's camera.
            Player player = Manager.createPlayer( "capture://video" );

            //Set the player to the REALIZED state (see Player docs.)
            player.realize();

            //Grab the video control and set it to the current display.
            _videoControl = (VideoControl)player.getControl( "VideoControl" );

            if (_videoControl != null)
            {
                //Create the video field as a GUI primitive (as opposed to a
                //direct video, which can only be used on platforms with
                //LCDUI support.)
                _videoField = (Field) _videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
                //Display the video control
                _videoControl.setVisible(true);
            }

            //Set the player to the STARTED state (see Player docs.)
            player.start();
        }
        catch(Exception e)
        {
            Dialog.alert( "ERROR " + e.getClass() + ":  " + e.getMessage() );
        }
    }
 
BTW it is possible to control size through debugger - it works
 
Any help is appreciated
Thank you 
Please use plain text.
Developer
cornplay
Posts: 20
Registered: ‎11-17-2008
My Device: Not Specified

Re: Viewfinder resize on 4.6 & 4.7 (Bold & Storm)

[ Edited ]

Does anyone have a success with resizing video region? I have the same problem as posted above.

 

It always throws MediaException "not supported" when VideoControl.setDisplaySize( int width, int height ) is invoked.

 

I've also tried to create a player using Manager.createPlayer( "capture://video?width=320&height=200" ) but it fails with MediaException "Media encoding parameter not specified"... :smileysad:

 

Any thoughts how to change video size?

Message Edited by cornplay on 11-17-2008 05:04 AM
Please use plain text.
New Developer
stoaster
Posts: 22
Registered: ‎10-23-2008
My Device: Bold

Re: Viewfinder resize on 4.6 & 4.7 (Bold & Storm)

I'm trying to do the same thing on the BB Bold and I get the same exception. Also, is there a way to access the flash when using the camera?

 

The native camera app has a lot more functionality than what's available via the MMAPI... Is there a way to invoke it just for taking pics, and then retrieving the pics it saved? 

 

Thanks

Nazmul.

Please use plain text.
New Developer
jasonpurdy
Posts: 5
Registered: ‎01-21-2009
My Device: Not Specified

Re: Viewfinder resize on 4.6 & 4.7 (Bold & Storm)

[ Edited ]
has anyone made any progress with this? Definitely seeing this as a problem on the Storm...
Message Edited by jasonpurdy on 02-10-2009 10:56 PM
Please use plain text.
New Developer
prasanna
Posts: 5
Registered: ‎06-12-2009
My Device: Not Specified

Re: Viewfinder resize on 4.6 & 4.7 (Bold & Storm)

HI,

 

  View finder can't be resized seems it's device issue. But one thing you can try is load view finder with out setFullscreenMode(true) method so that it get the default viewfinder size . Then you can set the positions by using setDisplaylocation method.  Make sure you are not suppose to use setFullScreenMode(false) for Blackberry bold 9000 device.

 

 

 Any issues please revert back.

Please use plain text.