new Scale Matrix - Android java.lang

Android examples for java.lang:Math Matrix

Description

new Scale Matrix

Demo Code


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

public class Main {
    public static Matrix newScaleMatrix(RectF src, RectF dst) {
        Matrix scale = new Matrix();
        scale.setRectToRect(src, dst, Matrix.ScaleToFit.CENTER);
        return scale;
    }//from  ww  w . j  av a 2  s .  c om
}

Related Tutorials