Alberto Michelis Well-Known Member Licensed User Longtime User Jul 5, 2019 #1 Hi, I dont know if I will explain it very well Compiling the example of CameraExClass, when I see the phone screen, the aspect ratio of the image is no ok, in portrait mode the image is taller than the reality and in landscape its wider but, when I save the picture is ok. Im using the code suggested in :https://www.b4x.com/android/forum/threads/cameraex-stretching-preview.62462/ This code changes the Panel1 layout ok, but what you see inside panel1 is still the same, in portrait taller and in lanscape wider. Last edited: Jul 5, 2019
Hi, I dont know if I will explain it very well Compiling the example of CameraExClass, when I see the phone screen, the aspect ratio of the image is no ok, in portrait mode the image is taller than the reality and in landscape its wider but, when I save the picture is ok. Im using the code suggested in :https://www.b4x.com/android/forum/threads/cameraex-stretching-preview.62462/ This code changes the Panel1 layout ok, but what you see inside panel1 is still the same, in portrait taller and in lanscape wider.
Peter Simpson Expert Licensed User Longtime User Jul 5, 2019 #2 Hello @Alberto Michelis, In CameraEx you can set the resolution that you require. For example a photo ratios are usually 4x3, so what I do is I loop through all the resolutions that the camera/phone can use until I reach one that has a ration of 4x3, for example 800x600 is 4x3, but I select a higher resolution that is 4x3. Once you find the resolution that you want to use, you can set CameraEx to use that resolution, for example 1600x1200 etc etc etc. Your screen preview might still look a bit off (which you can also set if need be), but the photo will look perfect. Upvote 0
Hello @Alberto Michelis, In CameraEx you can set the resolution that you require. For example a photo ratios are usually 4x3, so what I do is I loop through all the resolutions that the camera/phone can use until I reach one that has a ration of 4x3, for example 800x600 is 4x3, but I select a higher resolution that is 4x3. Once you find the resolution that you want to use, you can set CameraEx to use that resolution, for example 1600x1200 etc etc etc. Your screen preview might still look a bit off (which you can also set if need be), but the photo will look perfect.
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 5, 2019 #3 Problem is not the resolution, may be Im not explaining ok. Problem is, with the same resolution, in portrait mode you se the camera image taller and changing to landscape mode you see it wider. Upvote 0
Problem is not the resolution, may be Im not explaining ok. Problem is, with the same resolution, in portrait mode you se the camera image taller and changing to landscape mode you see it wider.
Peter Simpson Expert Licensed User Longtime User Jul 5, 2019 #4 Alberto Michelis said: Problem is not the resolution, may be Im not explaining ok. Problem is, with the same resolution, in portrait mode you se the camera image taller and changing to landscape mode you see it wider. Click to expand... Okay I've got you, I've not got my laptop on me at the moment but if my memory servers me correctly, what I do is rotate the bitmap, something like this before saving re-saving the image. Code: If ChkBoxSaveRotated.Checked Then BmpPhoto = BmpPhoto .Rotate(270) Else BmpPhoto = BmpPhoto .Rotate(0) Enjoy... Upvote 0
Alberto Michelis said: Problem is not the resolution, may be Im not explaining ok. Problem is, with the same resolution, in portrait mode you se the camera image taller and changing to landscape mode you see it wider. Click to expand... Okay I've got you, I've not got my laptop on me at the moment but if my memory servers me correctly, what I do is rotate the bitmap, something like this before saving re-saving the image. Code: If ChkBoxSaveRotated.Checked Then BmpPhoto = BmpPhoto .Rotate(270) Else BmpPhoto = BmpPhoto .Rotate(0) Enjoy...
Erel B4X founder Staff member Licensed User Longtime User Jul 7, 2019 #5 The default example doesn't set the panel size based on the preview ratio, so the image is expected to be stretched. You need to change the panel size before the camera is initialized. Upvote 0
The default example doesn't set the panel size based on the preview ratio, so the image is expected to be stretched. You need to change the panel size before the camera is initialized.