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

Adobe AIR Development

Reply
Contributor
varliali
Posts: 14
Registered: ‎03-11-2013
My Device: Dev Alpha B
Accepted Solution

Cameraroll added image name and path

How can I retrieve the name and path of the saved image in cameraroll?

Or is there a way to display the image in photo card?

 

var cameraRoll:CameraRoll = new CameraRoll();
cameraRoll.addEventListener(Event.COMPLETE, saveComplete);
cameraRoll.addBitmapData(bmpData);

 

Contributor
varliali
Posts: 14
Registered: ‎03-11-2013
My Device: Dev Alpha B

Re: Cameraroll added image name and path

 

Solved by selecting last image from camera folder.

 

var strDir:String = File.userDirectory.resolvePath('shared/camera').nativePath;
var fileCam:File = new File(strDir);
var files:Array = fileCam.getDirectoryListing();
files.sortOn("creationDate", Array.NUMERIC);
var lastFile:File = new File();
lastFile = files[files.length-1];

 

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Cameraroll added image name and path

Be careful of this method. If there are a lot of images in the folder, this call will become very slow. When I mean "a lot", I am talking thousands, so you should be OK under normal situations.