deletePicture Method

Use this command to remove a photo from your application's picture list.

intel.xdk.camera.deletePicture(pictureFilename);

Available Platforms:

Parameters:

  • pictureFilename: The filename of the image in the picture list. This filename can be obtained from camera.getPictureList

Events:

  • intel.xdk.camera.picture.remove: This event is fired once the deletePicture method has completed. It will return parameters indicating whether it was successful or not, as well as the filename of the photo referenced in the picture list.

Example:


document.addEventListener("intel.xdk.camera.picture.remove",onRemove); 
if (arrPictureList.length > 1)
{
  intel.xdk.camera.deletePicture(arrPictureList[0]);
}
function onRemove(evt)
{
  var arrPictureList = intel.xdk.camera.getPictureList();
  for (var x=0;x<arrPictureList.length;x++)
  {
    // create image 
    var newImage = document.createElement('img');
    newImage.src=intel.xdk.camera.getPictureURL(arrPictureList[x]);
    newImage.setAttribute("style","width:100px;height:100px;");
    newImage.id=document.getElementById("img_" + arrPictureList[x]);
    document.body.appendChild(newImage);
  }
  if(evt.success==true)
  {
    alert(evt.filename + " has been removed from the application's picture list");
  }
}
            
For more complete information about compiler optimizations, see our Optimization Notice.