docs: public static Bitmap drawViewToBitmap(Bitmap dest, View view, int downSampling, Bitmap.Config bitmapConfig) {
          float scale = 1f / downSampling;
          int viewWidth = view.getWidth();
          int viewHeight = view.getHeight();
          int bmpWidth = Math.round(viewWidth * scale);
          int bmpHeight = Math.round(viewHeight * scale);
  
          if (dest == null || dest.getWidth() != bmpWidth || dest.getHeight() != bmpHeight) {
              dest = Bitmap.createBitmap(bmpWidth, bmpHeight, bitmapConfig);
          }
  
          Canvas c = new Canvas(dest);
          if (downSampling > 1) {
              c.scale(scale, scale);
          }
  
          view.draw(c);
          return dest;
      }