get Rect Ratio - Android Graphics

Android examples for Graphics:Rectangle

Description

get Rect Ratio

Demo Code

/**//from w w w.  j a v a  2  s .c  o  m
 * @(#)RectFRectF.java   2014-8-29
 * Copyright 2014  it.kedacom.com, Inc. All rights reserved.
 */
//package com.java2s;
import android.graphics.RectF;

public class Main {

    public static float getRectRatio(RectF rect) {
        return rect.width() / rect.height();
    }
}

Related Tutorials