How to get a Rectangle for a BitmapFactory. Something like this a.getRectangle, where a is a BitmapFactory. As a result, you need to earn in this line of code
if (Rect.intersects (a.getRectangle (), b.getRectangle ()))
BitmapFactory allows you to get an image from a file or stream.Bitmap bitmap = BitmapFactory.decodeStream(inputStream);bitmap.getHeight , bitmap.getWidth - height and width of the bitmap.(Rect(int left, int top, int right, int bottom) , where left = 0, top = 0, right = bitmap.getWidth , bottom = bitmap.getHeight )Rectangle (Rect getBitmapRectangle(Bitmap bitmap)) at the output Rectangle (Rect getBitmapRectangle(Bitmap bitmap)) .if(Rect.intersects(getBitmapRectangle(a.decodeStream(inputStream1)),getBitmapRectangle(b.decodeStream(inputStream2)))...Source: https://ru.stackoverflow.com/questions/524992/
All Articles