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 17

    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.