首页 文章

如何制作目标宽度和高度大于640px高质量的PhoneGap相机图像?

提问于
浏览
2

我使用Cordova 3.5.0和Camera plugin的最新版本 . 当我将targetWidth和targetHeight设置为640以上时,我发现图像质量下降 . 这是我使用的配置:

navigator.camera.getPicture(onSuccess, onFail, 
  { quality : 100,
  destinationType : Camera.DestinationType.FILE_URI,
  sourceType : Camera.PictureSourceType.CAMERA,
  allowEdit : true,
  encodingType: Camera.EncodingType.JPEG,
  targetWidth: 640,
  targetHeight: 640,
  saveToPhotoAlbum: true 
});

我做了几次测试,用phonegap相机拍摄照片,并将自动保存的图像与相册进行比较 .

Here is the result (targetWidth: 640, targetHeight: 640)

enter image description here

Here is the result (targetWidth: 800, targetHeight: 800)

enter image description here

Here is the result (targetWidth: 1280, targetHeight: 1280)

enter image description here

当您单击链接并比较照片时,您会发现质量越差,图像越大 .

How can I make PhoneGap Camera images with target width and height bigger than 640px of high quality?

1 回答

  • 4

    尽量不要在相机选项中设置照片的高度和宽度,并在画布元素上操作最终图像 . 这样你就可以自己处理最优质的图像 .

相关问题