Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Camera Plugin.Media.Abstractions.StoreCameraMediaOptions always rotated landscape

tanvhtanvh Member ✭✭

var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
SaveToAlbum = true,
SaveMetaData = true,
Directory = "",
MaxWidthHeight = 1500,
CompressionQuality = 75,
PhotoSize = PhotoSize.Medium,
RotateImage = false,
});
when camera open , it's alway rotated landscape , phone & simulator set Portrait . Have StoreCameraMediaOptions any thing can set this issue ???
AND,
After take photo , can't resize image, i try use BitmapFactory to resize, but not working.

Have any thing can resolve 2 issue above , please tell me.
Thanks So much.

Answers

  • Rameshbodh_Rameshbodh_ Member ✭✭
    edited April 2019

    For android you can do something like this

    var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
    {
    SaveToAlbum = true,
    SaveMetaData = true,
    Directory = "",
    MaxWidthHeight = 1500,
    CompressionQuality = 75,
    PhotoSize = PhotoSize.Medium,
    RotateImage = Device.RuntimePlatform == Device.Android ? true : false,//this works for android
    });

    but for ios you can achieve by using dependency service

Sign In or Register to comment.