作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用带有内置相机插件的 Cordova 2.0。我的应用程序包含大量上传到远程服务器的照片,出于带宽和性能原因,我必须限制手机端文件的大小。
我使用以下相机选项拍摄新照片:
var options = {
quality : 30,
destinationType : navigator.camera.DestinationType.FILE_URI,
targetWidth: 1600,
targetHeight: 1200
}
这非常适合手机拍摄的照片,因为它们通常大于 1600x1200。但是,当我上传现有照片时,我不想将图像放大到小于目标分辨率:
var options = {
quality : 30,
sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY,
destinationType : navigator.camera.DestinationType.FILE_URI,
targetWidth: 1600,
targetHeight: 1200
};
实际上,我总是想避免扩大规模。关于如何更改相机插件的“缩放模式”有什么想法吗?
最佳答案
根据文档,http://docs.phonegap.com/en/2.2.0/cordova_camera_camera.md.html#camera.getPicture ,无论图像质量如何,照片库中的图像都无法缩放。仅当从手机中取出时。
关于ios - PhoneGap iOS - 仅当照片大于 targetheight/targetwidth 时才调整相机大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13101255/
我正在使用带有内置相机插件的 Cordova 2.0。我的应用程序包含大量上传到远程服务器的照片,出于带宽和性能原因,我必须限制手机端文件的大小。 我使用以下相机选项拍摄新照片: var op
我是一名优秀的程序员,十分优秀!