get Oval from Point - Android Graphics

Android examples for Graphics:Path Point

Description

get Oval from Point

Demo Code


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

public class Main {
    public static RectF getOval(final PointF center, final float radiusX,
            final float radiusY) {
        final RectF oval = new RectF();
        oval.left = center.x - radiusX;/*  w w  w .j a v  a 2s  .co m*/
        oval.top = center.y - radiusY;
        oval.right = center.x + radiusX;
        oval.bottom = center.y + radiusY;
        return oval;
    }
}

Related Tutorials