Picture orientation problem

ljcomp

Member
Licensed User
Longtime User
Hi All
I am using the advanced camera lib and have taken a picture, saved the picture then load the picture to an imageview. My problem is the picture is rotated in the imageview. I am using a tablet in prtrait mode and have changed the oriportrait orilandscape setting in the app so that what I preview in the camera panel is correct orientation.

B4X:
Sub Camera1_PictureTaken (Data() As Byte)


    camera1.StartPreview
    Dim out As OutputStream
    out = File.OpenOutput(File.DirRootExternal & "/treescape/images/","Image.jpg", False)
    out.WriteBytes(Data, 0, Data.Length)
    out.Close
   imageview1.Visible = True
   imageview1.Bitmap = LoadBitmap(File.DirRootExternal & "/treescape/images/","Image.jpg")
    'ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "Image.jpg"), True)
   End Sub
This is my picturetaken sub if it helps.

Cany anyone suggest a fix for this.

LJ
 

rtesluk

Member
Licensed User
Longtime User
Change image/ to image

Remove the / after image

"/treescape/images/","Image.jpg",

to

"/treescape/images","Image.jpg",

rtesluk
 
Upvote 0

pawelmic

Member
Licensed User
Longtime User
Really? Why?

Really? What does the extra / do, this makes no sense ...

I have a similar problem right now and I'm saving directly to
B4X:
File.DirRootExternal
while I'm testing? How do I fix my problem with the image being sideways?

B4X:
Sub Camera1_PictureTaken (Data() As Byte)
   
   camera1.StartPreview
   
   Dim out As OutputStream   
   
   out = File.OpenOutput(File.DirRootExternal, "test.jpg", False)
   out.WriteBytes(Data, 0, Data.Length)
   out.Close

when I later view the "test.jpg" on my phone is shows up sideways...:sign0085:
 
Upvote 0
Top