Forum Libraries, Components, and Plugins

Camera orientation bug on Xamarin.Mobile and IOS7

There is a bug in the MediaPicker component. When i take a photo the device orientation is not reflected on the orientation of the camera.
I've attached a picture of this bug.
To replicate the bug you can take a photo in portrait mode, change the device orientation to landascape and take another photo.

Any idea how resolve this problem?



    if used in full-screen it run ok:

    MediaPickerController mediaPickerController = 
        mediaPicker.GetTakePhotoUI (new StoreCameraMediaOptions 
        Name = "temp.jpg",
        Directory = "TMP"
    this.PresentViewController (mediaPickerController, true, null);
    mediaPickerController.GetResultAsync ().ContinueWith (t => {
    mediaPickerController.DismissViewController (true, () => {
            if (t.IsCanceled || t.IsFaulted) return;
            MediaFile media = t.Result;
            this.imgFoto.Image = UIImage.FromFile (media.Path);
    }, uiScheduler);
  • TomLaganTomLagan GBMember

    We are seeing something similar on Android - 100% landscape on Samsung devices, and happens occasionally on HTC Desire C. No issues on Nexus 4. Doesn't work at all on Sony Xperia Z.

  • VasundharaBhimavarapuVasundharaBhimavarapu USUniversity ✭✭

    Hi, I am also facing the same problem with my android application. did you solve that problem? if yes can you help me to get out of this issue.

  • ThomasNesserThomasNesser USMember

    We are experiencing the same problem, any solution to this problem?

  • I have the same issue. But I have found an alternative solution. Rotating the image by 90 will solve this issue.
    Here is the code,
    Bitmap resultBitmap = BitmapFactory.DecodeFile(path);
    Matrix mtx = new Matrix();
    resultBitmap = Bitmap.CreateBitmap(resultBitmap, 0, 0, resultBitmap.Width, resultBitmap.Height, mtx, false);

    If anyone have any better solution for this issue, please let me know.

Sign In or Register to comment.