Take pictures with the internal camera

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to all,
I'm following the Erel tutorial in order to take a pictures with internal camera.
The code work fine but when I display it in an imageview object the picture is in portrait mode.

The problem is that I take the picture in landscape mode.
Someone have any ideas about it?
 

luke2012

Well-Known Member
Licensed User
Longtime User
Before of all, thanks for your reply!
But my problem is that the picture is displayed in portrait mode and not in landscape mode.

I did that :

1) Thake picture with the internal camera
2) save the picture in a SQLite DB
3) Display it within an ImageView object (it show in portrait mode)

My problem is at point 3.
Why the picture is show in portrait mode and not in landscape mode?

Any Idea?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User

If I understood you correctly, what you should do is to put the ImageView on an activity in landscape mode, you will have to modify your Manifest to do that.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Right.
So you mean that the ImageView support only the portrait mode ?
The only way to do this is to modify the manifest ?

And if the answer is yes, do you known how?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
To change the orientation you have to open the Manifest Editor and add this line (assuming the activity where you have that ImageView is called Camera)
B4X:
SetActivityAttribute(Camera, android:screenOrientation, "landscape")
 
Upvote 0

Fred Borges

New Member
Licensed User
Longtime User
Please, post source code above
1) Thake picture with the internal camera
2) save the picture in a SQLite DB
3) Display it within an ImageView object (it show in portrait mode)
Thanks,
 
Upvote 0

Fred Borges

New Member
Licensed User
Longtime User
Thanks Erel. but I keep the photo in a imageview on my form. How I saved this photo as a field of record in sqlite? (i have a class that has a photo field as bitmapdrawable)
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…