0

Titanium SDK:2.1.1,主机操作系统:Mac OS X 10.6.8,移动平台:iOS 5

我无法访问 Titanium.Media.openPhotoGallery 的成功回调返回的“Blob”对象的某些属性。无法访问的属性是“file”和“nativePath”,但是我可以访问“height”、“width”和“mimeType”等属性。我在模拟器上测试。

这是我到目前为止编码的内容。

Titanium.Media.openPhotoGallery({
    success : function(event) {

        var image = event.media;

        if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {

            // following properties are accessible
            Ti.API.info(' event.media = ' + event.media );
            Ti.API.info('event.media.height = ' + event.media.height );
            Ti.API.info('event.media.width = ' + event.media.width );
            Ti.API.info('event.mediaType = ' + event.mediaType );

            // following properties are un-accessible
            Ti.API.info(' event.media.nativePath = ' + event.media.nativePath );
            Ti.API.info(' event.media.file = '  + event.media.getFile() );              
    },
    cancel : function() {},
    error : function(error) {},
    allowEditing : true,
    mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
});
4

1 回答 1

1

您无法从 iphone 照片库访问文件或文件本机路径。它无法访问。尽管您可以将所选图像存储在文件系统或 sqlite db 上,然后在其上执行所有任务...:)

于 2012-11-28T13:52:44.190 回答