I'm trying to rotate the image and save the rotated image to the database in Xamarin Form. However, after converting to byte arrays, both original and rotated images have the same result. Convert RotatedImage to BytesArray:
public static SKImage Rotate(byte[] imageBytesArray)
{
using (var bitmap = SKBitmap.Decode(imageBytesArray))
{
var rotated = new SKBitmap(bitmap.Height, bitmap.Width);
using (var surface = new SKCanvas(rotated))
{
surface.Translate(rotated.Width, 0);
surface.RotateDegrees(90);
surface.DrawBitmap(bitmap, 0, 0);
}
SKImage image = SKImage.FromBitmap(bitmap);
//return rotated;
return image;
}
}
This method returns the modified bytes array for the rotated Image, but the image is not actually rotated.