Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

import android.graphics.Canvas;

import java.util.List;

public class Main {
    @Deprecated
    public static Bitmap getCombinedByPieces(List<Bitmap> bitmapList, int numStages) {
        //TODO add here the method to greyscale to use the same canvas but to draw a grayscale version
        //i mean, don't use greyscale, but add here all the functionalities to reuse the canvas
        int originalTotalWidth = bitmapList.get(0).getWidth() * numStages;
        Bitmap finalBitmap = Bitmap.createBitmap(originalTotalWidth, bitmapList.get(0).getHeight(),
                Bitmap.Config.ARGB_8888);
        float delta = 0f;
        Canvas comboImage = new Canvas(finalBitmap);
        for (int i = 0; i < numStages; i++) {
            comboImage.translate(delta, 0f);
            comboImage.drawBitmap(bitmapList.get(i), 0f, 0f, null);
            delta = originalTotalWidth / numStages;
        }
        return finalBitmap;
    }
}