C COBRASoft Active Member Licensed User Longtime User Dec 31, 2011 #1 Hi, I'm trying to make a full sample project for the Advanced Camera Library. I have a big problem when the user wants to select another resolution. I want my preview panel to adjust in ratio according to the selected resolution but still be as big as possible on the devices screen. This seems to fail, it keeps the original width and height as it was when the camera was initialized. Any idea how to solve the problem with the aspect ratio of the camera preview? xVerhelstx? Please feel free to play with the included the project. I'll add more functionalities and 'gadgets' in the coming days. Specially the HUD above the camera has to be improved and I'll try to find better pictures. Be sure to check the menu out, 3 more settings are available there. EDIT: Post #5: updated version. Greetings, Sigurd Attachments Q2CCamera.zip Q2CCamera.zip 119.7 KB · Views: 1,113 Last edited: Jan 1, 2012
Hi, I'm trying to make a full sample project for the Advanced Camera Library. I have a big problem when the user wants to select another resolution. I want my preview panel to adjust in ratio according to the selected resolution but still be as big as possible on the devices screen. This seems to fail, it keeps the original width and height as it was when the camera was initialized. Any idea how to solve the problem with the aspect ratio of the camera preview? xVerhelstx? Please feel free to play with the included the project. I'll add more functionalities and 'gadgets' in the coming days. Specially the HUD above the camera has to be improved and I'll try to find better pictures. Be sure to check the menu out, 3 more settings are available there. EDIT: Post #5: updated version. Greetings, Sigurd
vb1992 Well-Known Member Licensed User Longtime User Dec 31, 2011 #2 You could add some error checking for flash this crashed in Froyo, but worked with this code Code: Copy Try lstFlashMode.Clear lstFlashMode.AddAll(objCamera.SupportedFlashMode) If LastFlashMode.Length = 0 Then LastFlashMode = objCamera.CurrentFlashMode SetFlashMode Catch Msgbox("You have no flash","FLASH") End Try Upvote 0
You could add some error checking for flash this crashed in Froyo, but worked with this code Code: Copy Try lstFlashMode.Clear lstFlashMode.AddAll(objCamera.SupportedFlashMode) If LastFlashMode.Length = 0 Then LastFlashMode = objCamera.CurrentFlashMode SetFlashMode Catch Msgbox("You have no flash","FLASH") End Try
vb1992 Well-Known Member Licensed User Longtime User Dec 31, 2011 #3 I also don't see much difference in file size from objCamera.Quality = 60 to objCamera.Quality = 95 But the overall quality at 95 is much better in the final saved photo/jpg I think this should be set to 95 Upvote 0
I also don't see much difference in file size from objCamera.Quality = 60 to objCamera.Quality = 95 But the overall quality at 95 is much better in the final saved photo/jpg I think this should be set to 95
C COBRASoft Active Member Licensed User Longtime User Jan 1, 2012 #4 Hi, Thanks for testing! I've put 60 just as example. I'll add a feature for the user to choose this setting. About error checking... I have to add it to many places. This is my first real 'test' with the camera and I have B4A only 1 week . I already have an idea to make it work better and to make the resolution change work with a work around. I hope to post a new build tomorrow. Greetings, Sigurd Upvote 0
Hi, Thanks for testing! I've put 60 just as example. I'll add a feature for the user to choose this setting. About error checking... I have to add it to many places. This is my first real 'test' with the camera and I have B4A only 1 week . I already have an idea to make it work better and to make the resolution change work with a work around. I hope to post a new build tomorrow. Greetings, Sigurd
C COBRASoft Active Member Licensed User Longtime User Jan 1, 2012 #5 Hi, I've updated the sample with some basic HUD elements (text for the moment). I also force the camera to initialize again when the resolution has changed. This way the preview is respecting the aspect ratio (please test). The HUD info can be turned off via the menu (info). Please let me know if problems arise or if you have suggestions... P.S.: the updated zip can be found in the first post of this thread. Greetings, Sigurd Upvote 0
Hi, I've updated the sample with some basic HUD elements (text for the moment). I also force the camera to initialize again when the resolution has changed. This way the preview is respecting the aspect ratio (please test). The HUD info can be turned off via the menu (info). Please let me know if problems arise or if you have suggestions... P.S.: the updated zip can be found in the first post of this thread. Greetings, Sigurd
M mcmanu Active Member Licensed User Longtime User Jan 3, 2012 #6 Hi Thanks your Example But it doesn´t work in my app to set oriportrait But now i fixed it, if you use try catch than it works perfectly code--> Sub Camera1_Ready (Success As Boolean) If success Then Try camera1.OriPortrait Catch End Try Camera1.StartPreview button5.Enabled = True Else ToastMessageShow("Kamera konnte nicht geöffnet werden.", True) End If End Sub Sorry because of my english Upvote 0
Hi Thanks your Example But it doesn´t work in my app to set oriportrait But now i fixed it, if you use try catch than it works perfectly code--> Sub Camera1_Ready (Success As Boolean) If success Then Try camera1.OriPortrait Catch End Try Camera1.StartPreview button5.Enabled = True Else ToastMessageShow("Kamera konnte nicht geöffnet werden.", True) End If End Sub Sorry because of my english
R rtesluk Member Licensed User Longtime User Mar 15, 2012 #7 Combining Portrait & Landscape This also works Code: Copy If Activity.Width > Activity.Height Then Try Camera1.OriLandscape Catch Msgbox (LastException.Message,"Camera1_Ready - Land") End Try Else Try Camera1.OriPortrait Catch Msgbox(LastException.Message,"Camera1_Ready - Port") End Try End If rtesluk Upvote 0
Combining Portrait & Landscape This also works Code: Copy If Activity.Width > Activity.Height Then Try Camera1.OriLandscape Catch Msgbox (LastException.Message,"Camera1_Ready - Land") End Try Else Try Camera1.OriPortrait Catch Msgbox(LastException.Message,"Camera1_Ready - Port") End Try End If rtesluk
C COBRASoft Active Member Licensed User Longtime User Mar 21, 2012 #8 Samsung Galaxy SII Hi xVerhelstx, For some reason the camera.release is giving problems on the Samsung Galaxy SII. It takes a really long time to release the camera. Strangely enough, in debug mode the release is almost instant. Any idea what this could be? I don't have the problem on my SE Xperia Arc S and Motorola Droid... Greetings, Sigurd Upvote 0
Samsung Galaxy SII Hi xVerhelstx, For some reason the camera.release is giving problems on the Samsung Galaxy SII. It takes a really long time to release the camera. Strangely enough, in debug mode the release is almost instant. Any idea what this could be? I don't have the problem on my SE Xperia Arc S and Motorola Droid... Greetings, Sigurd
R rtesluk Member Licensed User Longtime User Mar 21, 2012 #9 Use Tools -> Clean Project Mar 21 2012 07:30 Houe I found out that 'cleaning' the project seemed to remove some niggling problems using the ACL (Advanced Camera Library). rtesluk :sign0104: Upvote 0
Use Tools -> Clean Project Mar 21 2012 07:30 Houe I found out that 'cleaning' the project seemed to remove some niggling problems using the ACL (Advanced Camera Library). rtesluk :sign0104:
C COBRASoft Active Member Licensed User Longtime User Mar 21, 2012 #10 I clean my project often because I use Nine Patch Images now for most drawings and backgrounds. So this is not the reason. And since it's working on my other 2 devices with exactly the same build... It must be something weired in the release code (my guess). Upvote 0
I clean my project often because I use Nine Patch Images now for most drawings and backgrounds. So this is not the reason. And since it's working on my other 2 devices with exactly the same build... It must be something weired in the release code (my guess).
M Mickster Active Member Licensed User Longtime User Sep 4, 2012 #11 Hi xVerhelstx, For some reason the camera.release is giving problems on the Samsung Galaxy SII. It takes a really long time to release the camera. Strangely enough, in debug mode the release is almost instant. Any idea what this could be? I don't have the problem on my SE Xperia Arc S and Motorola Droid... Greetings, Sigurd Click to expand... I developed my app on HoneyComb and had a working Camera feature. Since updating to ICS, I've been seeing this same issue. Did you ever solve it? Upvote 0
Hi xVerhelstx, For some reason the camera.release is giving problems on the Samsung Galaxy SII. It takes a really long time to release the camera. Strangely enough, in debug mode the release is almost instant. Any idea what this could be? I don't have the problem on my SE Xperia Arc S and Motorola Droid... Greetings, Sigurd Click to expand... I developed my app on HoneyComb and had a working Camera feature. Since updating to ICS, I've been seeing this same issue. Did you ever solve it?