SlashIT Member Licensed User Longtime User Sep 21, 2016 #1 Hello, I'm using "LLCamera" to acquire an image from the camera and simultaneously overlay a picture; until here, everything ok. I want to manually calculate the aspect ratio, how do I get the actual width and height of the camera, so I can calculate the correct aspect ratio of the image overlay? thank you
Hello, I'm using "LLCamera" to acquire an image from the camera and simultaneously overlay a picture; until here, everything ok. I want to manually calculate the aspect ratio, how do I get the actual width and height of the camera, so I can calculate the correct aspect ratio of the image overlay? thank you
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2016 #2 Set PreserveRatio to true and explicitly set one of the preset constants. Upvote 0
SlashIT Member Licensed User Longtime User Sep 21, 2016 #3 Erel said: Set PreserveRatio to true and explicitly set one of the preset constants. Click to expand... Hello Erel, thanks for the reply but I think you did not understand the question: in B4A use this code: Code: Copy Globals ...Private camEx As CameraExClass Activity_create ...camEx.Initialize(Panel1, True, Me, "Camerax") Sub Camerax_Ready (Success As Boolean) If Success Then ratio = camEx.GetPreviewSize.Width / camEx.GetPreviewSize.Height End If End Sub how can I do with LLCamera? thank you Upvote 0
Erel said: Set PreserveRatio to true and explicitly set one of the preset constants. Click to expand... Hello Erel, thanks for the reply but I think you did not understand the question: in B4A use this code: Code: Copy Globals ...Private camEx As CameraExClass Activity_create ...camEx.Initialize(Panel1, True, Me, "Camerax") Sub Camerax_Ready (Success As Boolean) If Success Then ratio = camEx.GetPreviewSize.Width / camEx.GetPreviewSize.Height End If End Sub how can I do with LLCamera? thank you
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2016 #4 If you explicitly set the preset then you will know the preview size. Code: Copy Camera.Preset = Camera.PRESET_1280x720 Camera.PreserveRatio = True Upvote 0
If you explicitly set the preset then you will know the preview size. Code: Copy Camera.Preset = Camera.PRESET_1280x720 Camera.PreserveRatio = True