Created
December 24, 2011 18:10
-
-
Save yonestra/1517969 to your computer and use it in GitHub Desktop.
PhotoGalleryの写真を新規ファイルとしてアプリ内に保存する ref: http://qiita.com/items/1442
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Titanium.Media.openPhotoGallery({ | |
success: function(event) { | |
// アプリケーションデータディレクトリに出力する。 | |
var f = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory + "/" + 'name.png'); | |
if (!f.exists()) { | |
f.createFile(); | |
} | |
f.write(event.media); | |
}, | |
error: function(error) { | |
// notify(e.message); | |
}, | |
cancel: function() { | |
// キャンセル時の挙動 | |
}, | |
// 撮影データのフォトギャラリーへの保存 | |
saveToPhotoGallery:true, | |
// 選択直後に拡大縮小移動をするか否かのフラグ | |
allowEditing: true, | |
// 選択可能なメディア種別を配列で指定 | |
mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment