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

Saving Image differently

Hi all,

 

How can i save an image in a way that doesn't show up in the pictures app on the device? I am using ForeignWindowControl to show camera and capture image but I am following a sample which just saves the image to camera directory in stillcallback function. I would like to only show and have access to the images captured via my app.

 

Any advice appreciated.

Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Saving Image differently

Can't you just save it in to your apps data folder?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Saving Image differently

Thanks for the reply,

 

Probably, I'm currently using camera_roll_open_photo to write the data to device but what would I need to do/change to save in my apps data folder instead? 

Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Saving Image differently

I've not looked at the camera API's at all yet but if there is no direct way to ask the api to save elsewhere then you will have to use QFile to move it.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Saving Image differently

Thanks,

 

Ive used QFile::rename(filename, newFilename); to move the file to data folder.

 

One more question - anyway to create a folder within the data folder - I have tried saving an image using ./data/campturedimages/image.jpeg but it doesn't create a capturedimages folder.

 

Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Saving Image differently

[ Edited ]

Can I suggest you close off this thread accepting my post above as the solution and then open a new thread with your new problem including the code you have tried to use, there should be no problem creating a folder within your apps data area.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 660
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Saving Image differently

the correct answer is to just create your own filename in your app's sandbox.

The camera_roll_open_photo() API is designed specifically to provide a new filename in the shared directory.  Since you don't want to do so, just don't use that function to get a filename.  Instead, open() your own file.

 

Cheers,

Sean

Please use plain text.