Home > Software engineering >  How to draw a transparent rectangle in the center?
How to draw a transparent rectangle in the center?

Time:09-17

I'm using CameraX to scan QR. For the UI side, I need to create a translucent black background along with a transparent box in the center (of given side [or of given padding if the side can be calculated]).

I tried using different solutions on stackoverflow but for some reason was unable to achieve this. Currently, I'm trying to use this solution to create a square of given side (width/height) but am unable to do so. I tried modifying the code provided in the first answer here enter image description here

  • Related