Code example for Matrix

Methods: invertmapRectsetRectToRect

0
        if (photoBounds.isEmpty()) {
            return; 
        } 
 
        // Assumes photo-view is also full-screen as this tool-view and centers/scales photo to fit. 
        Matrix matrix = new Matrix();
        if (matrix.setRectToRect(photoBounds, new RectF(0, 0, w, h), Matrix.ScaleToFit.CENTER)) {
            matrix.mapRect(displayBounds, photoBounds);
        } 
 
        matrix.invert(photoMatrix);
    } 
 
    protected float getPhotoWidth() { 
        return photoBounds.width();
    } 
 
    protected float getPhotoHeight() { 
        return photoBounds.height();
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE