Sub Camera1_PictureTaken (Data() As Byte)
camera1.StartPreview
camera1.SavePictureToFile(Data,File.DirDefaultExternal, "tmp.jpg")
Dim bmp As Bitmap=LoadBitmapSample(File.DirDefaultExternal, "tmp.jpg",100%x,100%y)
Dim bm As BitmapExtended
bmp=bm.rotateBitmap(bmp,-rotated90)
Dim Out As OutputStream
Out = File.OpenOutput(File.DirDefaultExternal, "Test.png", False)
bmp.WriteToStream(Out, 100, "JPEG")
Out.Close
.....
where rotated90 is a variable updated with accelerometer.
Now I would like to do the rotation without uncompressing/recompressing jpg and without using a temporary file.