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
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30
Accepted Solution

Best option to take a picture

I want to present the user with a camera that can take a picture, and only a picture. No video or time-shift.

 

I want flash to be defaulted to auto and I do not want users to be able to select the camera roll.

 

I also do not want the image to be saved to the camera roll.

 

It seems there are several different ways in QML, qt, c++ and c to achieve this. What is the best practice for showing a camera that can just take a picture and not save the image to the camera roll?

Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
New Developer
xuleilei1982
Posts: 6
Registered: ‎04-16-2012
My Device: playbook
My Carrier: rim

Re: Best option to take a picture

i also have this question
Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Best option to take a picture

Bumping this thread to hopefully see an answer
Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Best option to take a picture

Invoking the camera card is your easiest bet. you can specify that it run in photo mode only. I dont think you can specify flash modes, etc. explicitly. they will be based on the user's current camera app settings.

 

Your next best bet is using the Cascades Camera control.  it's pretty easy to use and has a bit more controllability.

 

I have lots of samples (but they are mainly C or C++) here...

http://blackberry.github.io/Community/Camera.html

 

check for the link to "PhotoBomber" or hunt around for "Cloudy Pics" which Paul Bernhardt wrote.

Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Best option to take a picture

Is there a way to invoke the card and *not* have it save to the camera roll?
Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Best option to take a picture

Nope.

Same with Cascades Camera API.

Only way to do this presently is via native C/C++ code, which you probably don't want to deal with.

Though if you do... you can grab the "BestCamera" sample and use that as a starting point.  I wanted to turn this into a custom component, but time has not permitted yet :smileysad:

 

Cheers,

Sean

Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Best option to take a picture

That's what I was afraid of. Thank you for responding
Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Best option to take a picture

You can use the camera control in Cascades to save it to somewhere other than the camera roll, but it can't be inside your apps private directory. So you could save it to the SD card or Dropbox or something.

 

If you need the image to be stored in your app's private directory, or never written to the filesystem at all, as Sean says BestCamera with the C API is your best bet.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Best option to take a picture

[ Edited ]

Correction: The camera roll can be pointed inside your private sandbox, but only in software versions newer than 10.2.1 (inclusive).

 

I've asked for the docs to be updated on this, but I don't think that has happened yet.

Please use plain text.
Developer
dhicock
Posts: 54
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Best option to take a picture

Until the docs get updated, can you give examples on here on how to do that sort of thing?
Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Please use plain text.