手机峡相机方向方向、相机、手机

由网友(他说世间无爱。)分享简介:我已经用电话差距版本开发的应用程序的 0.9.3 I have developed an app using Phone Gap version 0.9.3...当我在我的应用程序打开相机,它总是在横向模式下打开,并在拍摄时,图像横向格式返回... When I open camera in my app ,i...

我已经用电话差距版本开发的应用程序的 0.9.3

I have developed an app using Phone Gap version 0.9.3...

当我在我的应用程序打开相机,它总是在横向模式下打开,并在拍摄时,图像横向格式返回...

When I open camera in my app ,it always opens in landscape mode and, on capture, the image is returned in landscape format...

如何更改摄像头的模式,人像

How can I change the mode of camera to portrait

navigator.camera.getPicture(onsuccess, fail, {quality: 45,destinationType : Camera.DestinationType.DATA_URL, sourceType: src},img_id);

function onsuccess(imageData) {
    localStorage.setItem("image_captured","Yes");
    $('#'+imgID).attr('src', 'data:image/jpeg;base64,' + imageData);
    $("#"+imgID+"_IMG").attr('src', 'data:image/jpeg;base64,' + imageData);
}

在清单中,我不得不提的:

In manifest i had mention:

<activity android:name="com.android.camera.Camera"
    android:screenOrientation="portrait">
</activity>

请帮我在这...

推荐答案

base64格式返回一个图像时(所有的EXIF数据已被剥离)。照片显示方向不存储

photo orientation is not stored when returning an image in base64 format (all EXIF data is stripped).

您应该使用加速度计或屏幕方向知道,如果图像是纵向还是横向的,然后相应地显示出来。

You should use the accelerometer or screen orientation to "know" if the image was taken in portrait or landscape and then display it accordingly.

阅读全文

相关推荐

最新文章