get Center From Rect - Android Graphics

Android examples for Graphics:Rectangle

Description

get Center From Rect

Demo Code


//package com.java2s;
import android.graphics.RectF;

public class Main {
    public static float[] getCenterFromRect(RectF r) {
        return new float[] { r.centerX(), r.centerY() };
    }//from   w  w w . ja  va 2  s .c  o m
}

Related Tutorials