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

Native Development

Reply
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Camera question

Hi,

 

I am showing the view of the camera in my app using ForeignWindowControl, I would like to be able to make my view as similar to the native camera app's view as possible - i.e using the autofocus rectangle which goes green.

 

Is this possible - can i use the same autofocus rectangle in my camera app and if so how?

Please use plain text.
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Re: Camera question

Yes you can achieve this, what i have done as per my project requirement to invoke camera i am sharing it with you.

 

 attachedObjects: [
                                FilePicker {
                                    id: picker
                                    property string selectedFile
                                    title: qsTr("File Picker")
                                    mode: File.selectedValue
                                    /*type: pickerType.selectedValue*/
                                    type: FileType.Picture
                                    viewMode: pickerViewMode.selectedValue
                                    sortBy: pickerSortBy.selectedValue
                                    sortOrder: pickerSortOrder.selectedValue
                                    /*  directories : ["/accounts/1000/shared/misc"]*/
                                    onFileSelected: {
                                        selectedFile = selectedFiles[0]
                                        user_image.imageSource = "file://" + selectedFile;
                                        imagePath = "file://" + selectedFile;
                                        /* console.debug("picker.selectedFile : " + picker.selectedFile);
                                         * if (fileInfo.isImage(picker.selectedFile)) {
                                         * console.debug("roomsListPage: an image was picked")
                                         * roomsListPage.previewImage(picker.selectedFile);
                                         * return;
                                         * }*/
                                    }
                                }
                            ]

 trap click event of button and put this code snippet 

  picker.type = FileType.Picture
                                    picker.directories = [
                                    ]
                                    picker.open();

 

Deepak Charya
Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Camera question

Thanks Deepak,

 

I don't think invoking the camera as a card is the solution for me however as I want silence the camera (purpose of my app).

 

I have the camera showing in ForeignWindowControl and silenced but I want to have finer control of the camera as I have seen another app do it - show the rectangle in centre of camera view which turns green (I think its focusing or auto stabilizing) so I think it is possible. 

 

Anyone shed some light on this please?

Please use plain text.
Developer
dcharya
Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Re: Camera question

Hi JohnWS

 

i found a solution to this prob if i am actually understand what u need.

 

Have a look on this sharing a working sample of invoking camera 

 

Hope this may help you :smileyhappy:

 

Regards

Deepak Charya
Please use plain text.