RectF To Rect - Android Graphics

Android examples for Graphics:Rectangle

Description

RectF To Rect

Demo Code


import android.graphics.Rect;
import android.graphics.RectF;

public class Main {
  public static Rect rectfToRect(RectF rect) {
    Rect r = new Rect((int) rect.left, (int) rect.top, (int) rect.right,
        (int) rect.bottom);
    return r;/*from w ww.j a  va2 s . c  o  m*/
  }
}

Related Tutorials