User control assertion error: Control must be added to the page first #4693
Unanswered
cornelius080
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The error occurs due to the image update that is being performed in the function capture_from_webcam. I see that you delete the class camManager when the button is pressed, maybe this will generate the error. Myabe you can create a new function to clean the space, but not delete the class |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hi all,
I'm trying to display the video captured from the webcam into a Flet app with a container and a button to start/stop capturing. All about webcam operations, performed through the Opencv library, are defined into a separated class that represent an User Control that corresponds to an image. The User control is defined into the main() but is added to the page into the button_on_click event. In the same method, there is also the call to the function to switch off the webcam (dispose()).
After pressing the button some time, I got the exception: assertion error: Control must be added to the page first
Does anyone have some tips to prevent this error?
Code sample
Error message
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions