When you take a photo, a bitmap has a correct orientation. But bmp.WriteToStream does not write 'orientation' tag in Exif.
I found three parameters only : ColorSpace, PixelXDimension, PixelYDimension). Means IOS will assume UIImageOrientationUp.
Workaround ...
1) Add to the bottom
#If OBJC
- (UIImage*) removeOrientation: (UIImage*) image { return [UIImage imageWithCGImage: [image CGImage] scale: [image scale] orientation: UIImageOrientationUp]; }
#End If
2) In PictureTaken after receiving a bitmap (let's name it bmp):
a) get image orientation
Dim byteOrientation As Byte = bmp.As(NativeObject).GetField("imageOrientation").AsNumber
b) set image orientation to UIImageOrientationUp (means The original pixel data matches the image's intended display orientation).
Dim no As NativeObject = Me
bmp = no.RunMethod ("removeOrientation:", Array (bmp))
c) rotate a bitmap
Select Case byteOrientation
Case 0
' bmp = bmp.Rotate (0)
Case 1
bmp = bmp.Rotate (180)
Case 2
bmp = bmp.Rotate (270)
Case 3
bmp = bmp.Rotate (90)
End Select
After this you can use bmp.WriteToStream.