imageview - Android Bounding Rectangles -


I am trying to create a boundary rectangle around an image view to detect conflicts. Unfortunately, I can not only search for the code for sprites and not ImageViews. Is there a way to make a rectangle that goes out of the image for an image? One of the imageview runs through an animation, while the other still remains.

Using images for moving animation is not a good idea, although there are too many resources in it, You can set the width and height to WRAP_CONTENT and use the image size as a bounding rectangle

Setting your xml layout in Android: layout_height and android: Layout_width "wrapping content" of your ImageView And when you need to force the boundaries of image views:

  ... int [] l = new int [2]; ImageView.getLocationOnScreen (L); Int x = l [0]; Int y = l [1]; Int w = imageView.getWidth (); Int h = imageView.getHeight (); ...   

x, y, w, h ??? Bounding rect is required in screen coordinates

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -