uniplan Active Member Licensed User Longtime User Oct 14, 2024 #1 I am using the camera2 library and the CamEx2 module. I looked at the tutorial and the related example and everything works relatively well. I would like to have the possibility to let the user who takes the photo choose the size to use. I can list the possible sizes with the following code: B4X: Dim PreviewSizes As List = cam.GetSupportedCaptureSizes() For Each Size As CameraSize In PreviewSizes Log("Width: " & Size.Width & ", Height: " & Size.Height) Next but how do you set the size? I saw that the CamEx2 module in the initialization function has the instruction: B4X: CaptureSize.Initialize(1920, 1080) But what if I want to change this size after the module has been initialized, how can I do that?
I am using the camera2 library and the CamEx2 module. I looked at the tutorial and the related example and everything works relatively well. I would like to have the possibility to let the user who takes the photo choose the size to use. I can list the possible sizes with the following code: B4X: Dim PreviewSizes As List = cam.GetSupportedCaptureSizes() For Each Size As CameraSize In PreviewSizes Log("Width: " & Size.Width & ", Height: " & Size.Height) Next but how do you set the size? I saw that the CamEx2 module in the initialization function has the instruction: B4X: CaptureSize.Initialize(1920, 1080) But what if I want to change this size after the module has been initialized, how can I do that?
Solution Erel Oct 15, 2024 Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean)
Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean)
Erel B4X founder Staff member Licensed User Longtime User Oct 15, 2024 #2 Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean) Upvote 0 Solution
Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean)
uniplan Active Member Licensed User Longtime User Oct 15, 2024 #3 Erel said: Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean) Click to expand... it works thanks Upvote 0
Erel said: Something like: Code: cam.PreviewSize.Initialize(1920, 1080) Wait For (cam.PrepareSurface(MyTaskIndex)) Complete (Success As Boolean) Click to expand... it works thanks