Hi,
Using the demo app that comes with the camera lib I did the following. First added an imageview to the main display just to test the results.
I also added the JPegUtils and RSImage Processing libraries to my app.
Added the following function to my code:
Sub rotateBy (dir As String, Filename As String) As Int
Dim retValue As Int = 0
Dim filepath As String
Dim exif As ExifData
filepath = dir & "/" & Filename
exif.Initialize("", filepath)
' // Get orientation
Dim w As Int = exif.getAttributeInt (exif.TAG_ORIENTATION, 0)
If w = exif.ORIENTATION_NORMAL Then retValue = 0
If w = exif.ORIENTATION_ROTATE_90 Then retValue = 90
If w = exif.ORIENTATION_ROTATE_180 Then retValue = 180
If w = exif.ORIENTATION_ROTATE_270 Then retValue = 270
Return retValue
End Sub
And then in the Camera1_PictureTaken function after the line
camEx.SavePictureToFile(Data, dir, filename)
I added:
Dim RSIE As RSImageEffects
Dim rotate As Int = rotateBy(dir, filename)
Dim tmpBitmap As Bitmap
tmpBitmap = LoadBitmap(dir, filename )
ImageView1.Gravity = Gravity.NO_GRAVITY
ImageView1.Bitmap = RSIE.rotate(tmpBitmap, rotate)
This simply uses the exif data contained in the saved image and works out the number of degrees to rotate the image by. I then load the image into a temporary bitmap field and rotate it using RSImage library. Finally I put the resulting bitmap into the imageview to test the results.
There may well be a better way of doing this without having to save the file first.