Phonegap を使用してカメラ画像を取得し、HTML5 キャンバスに出力しています。
背面カメラを使用するとすべてがうまく機能しますが、前面カメラを使用すると、画像が上下逆さまに表示されます。
誰かがこの問題に遭遇しましたか? なぜこれが起こっているのかについてのアイデアはありますか?
写真の撮影に使用されたカメラを特定する方法はありますか?
以下は私のコードです:
//take picture on click
$("#camera").click(function(){
//Take picture using device camera and retrieve image as base64-encoded string
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50 });
})
// Called when a photo is successfully retrieved in base64 format.
// It draws the photo on the canvas.
function onPhotoDataSuccess(imageData) {
var imageObj = new Image();
imageObj.onload = function(){
drawImage(cbook, this);
};
imageObj.src = imageData;
}
ありがとう。