Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;

public class Main {
    /**
     * 
     * @param paint
     */
    public static void invertCanvasColors(Paint paint) {
        float mx[] = { -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f,
                1.0f, 1.0f, 1.0f, 1.0f, 0.0f };
        ColorMatrix cm = new ColorMatrix(mx);
        paint.setColorFilter(new ColorMatrixColorFilter(cm));
    }
}