title: How to draw rectangle at CameraX TextureView
body: <p>I wrote the below code to draw a red rectangle, but apparently it is wrong :( I did not get any error, in same time did not get anything drawn, how can I fix it </p>
  
  <pre><code>    private fun updateTransform() {
          val matrix = Matrix()
  
          // Compute the center of the view finder
          val centerX = viewFinder.width / 2f
          val centerY = viewFinder.height / 2f
  
          // Correct preview output to account for display rotation
          val rotationDegrees = when(viewFinder.display.rotation) {
              Surface.ROTATION_0 -&gt; 0
              Surface.ROTATION_90 -&gt; 90
              Surface.ROTATION_180 -&gt; 180
              Surface.ROTATION_270 -&gt; 270
              else -&gt; return
          }
          matrix.postRotate(-rotationDegrees.toFloat(), centerX, centerY)
  
          val bmp = Bitmap.createBitmap(1425, 1425, Bitmap.Config.ARGB_8888)
          val paint = Paint().apply {
              isAntiAlias = true
              style = Paint.Style.STROKE
              color = Color.RED
              strokeWidth = 10f
          }
          // x: {559, y: 1901}, height: 1425, width: 1425
          var canvas = Canvas(bmp)
          canvas.apply {
              drawRect(
                  25.toFloat(), // faceRectangle.left,
                  25.toFloat(), //faceRectangle.top,
                  250.toFloat(),
                  250.toFloat(),
                  paint
              )
          }
  
          viewFinder.unlockCanvasAndPost(canvas)
  
          viewFinder.setTransform(matrix)
  
      }
  </code></pre>