【问题标题】:Need to get capturing image current orientation需要获取图像当前方向
【发布时间】:2012-12-21 10:21:38
【问题描述】:

嗨,在我的 android phonegap 应用程序中,当我以纵向模式拍摄图像时,在检索图像时图像会旋转。

这是我捕获图像的代码:

navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 1});

如果我将正确的方向设置为 true 没有什么区别。

如果我使用以下代码,则图像以正确的方向存储但保存在缓存中。是否有任何解决方案可以保存在 DCIM\Camera 路径中?

navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
            destinationType: navigator.camera.DestinationType.FILE_URI, 
            correctOrientation: true });

请帮助我。在此先感谢

【问题讨论】:

  • 创建一个图像视图并将拍摄的照片传递给该视图

标签: android cordova


【解决方案1】:

要拍摄照片,您需要使用 getPicture 方法,并将照片存储在 DCIM\Camera 路径上,您需要打开 true saveToPhotoAlbum 参数。

navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
        destinationType: navigator.camera.DestinationType.FILE_URI, 
        saveToPhotoAlbum: true,
        correctOrientation: true });

【讨论】:

  • 嘿,当我使用这件作品时,它并不叫相机。我正在使用“cordova-plugin-media-capture-r0.3.3”插件。你能澄清一下吗?
  • 这个解决方案是对 JavaH 请求的回答,使用“cordova-2.1.0”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-24
  • 2019-12-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多