Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. val bw = bitmap.width
  2. val width = vF_atv_camera_preview!!.width;
  3. val height = vF_atv_camera_preview!!.height;
  4. val location = IntArray(2)
  5. vL_atv_box!!.getLocationOnScreen(location);
  6. val l = location[0] * bw / width
  7. val t = location[1] * bh / height
  8. val w = vL_atv_box!!.getWidth() * bw / width;
  9. val h = vL_atv_box!!.getHeight() * bh / height;
  10. val resizedBitmap = Bitmap.createBitmap(bitmap, l, t, w, h);
  11.  
  12. It's not cropping properly in all screen size, Please help me.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement