You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/07/14 02:24:42 UTC
[22/46] wp7 commit: [CB-925] saveToPhotoAlbum CameraOption
[CB-925] saveToPhotoAlbum CameraOption
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/9e861730
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/9e861730
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/9e861730
Branch: refs/heads/master
Commit: 9e86173089dee32935abb5e00e3b1034b57cf9cf
Parents: f08f483
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jul 13 11:45:57 2012 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jul 13 11:45:57 2012 -0700
----------------------------------------------------------------------
templates/standalone/cordovalib/Commands/Camera.cs | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/9e861730/templates/standalone/cordovalib/Commands/Camera.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/Camera.cs b/templates/standalone/cordovalib/Commands/Camera.cs
index 5eb3337..5963c81 100644
--- a/templates/standalone/cordovalib/Commands/Camera.cs
+++ b/templates/standalone/cordovalib/Commands/Camera.cs
@@ -101,6 +101,12 @@ namespace WP7CordovaClassLib.Cordova.Commands
[DataMember(IsRequired = false, Name = "quality")]
public int Quality { get; set; }
+ /// <summary>
+ /// Controls whether or not the image is also added to the device photo album.
+ /// </summary>
+ [DataMember(IsRequired = false, Name = "saveToPhotoAlbum")]
+ public bool SaveToPhotoAlbum { get; set; }
+
/// <summary>
/// Height in pixels to scale image
@@ -135,6 +141,7 @@ namespace WP7CordovaClassLib.Cordova.Commands
Quality = 80;
TargetHeight = -1;
TargetWidth = -1;
+ SaveToPhotoAlbum = false;
}
}
@@ -210,8 +217,11 @@ namespace WP7CordovaClassLib.Cordova.Commands
if (cameraOptions.DestinationType == FILE_URI)
{
// Save image in media library
- // MediaLibrary library = new MediaLibrary();
- // Picture pict = library.SavePicture(e.OriginalFileName, e.ChosenPhoto); // to save to photo-roll ...
+ if (cameraOptions.SaveToPhotoAlbum)
+ {
+ MediaLibrary library = new MediaLibrary();
+ Picture pict = library.SavePicture(e.OriginalFileName, e.ChosenPhoto); // to save to photo-roll ...
+ }
int orient = ImageExifHelper.getImageOrientationFromStream(e.ChosenPhoto);
int newAngle = 0;