Titanium mobile 如何知道画廊图片的重量?
我怎么知道attch的重量?如果可能,库中文件的名称。如文档中所述,方法Titanium mobile 如何知道画廊图片的重量?,titanium-mobile,appcelerator,Titanium Mobile,Appcelerator,我怎么知道attch的重量?如果可能,库中文件的名称。如文档中所述,方法success将返回一个包含属性media的对象,该属性是Blob格式的图像/视频。如果您想知道图像的宽度,请执行以下操作: Ti.Media.openPhotoGallery({ success:function(event) { attch = event.media; }, cancel:function(){ consol
success
将返回一个包含属性media
的对象,该属性是Blob格式的图像/视频。如果您想知道图像的宽度,请执行以下操作:
Ti.Media.openPhotoGallery({
success:function(event) {
attch = event.media;
},
cancel:function(){
console.log("error!");
}
});
你正在使用的图书馆是什么?你也试过event.media.width吗?什么?体重?您期望的值是多少?存储卡中的值,以KB或字节为单位的值,移动设备内存中的文件大小
Ti.Media.openPhotoGallery({
success: function(event) {
var image = event.media;
console.log(image.width);
console.log(image.size); // image size in bytes
}
});