Code example for Bitmap

Methods: getConfiggetHeightgetWidthrecycle

0
        return bmOverlay;
    } 
 
    public static Bitmap overlayTiled(final int neww, final int newh,
            final Bitmap bsrc, final Boolean islandscape, final int screenCount) {
        int srcw = bsrc.getWidth();
        int srch = bsrc.getHeight();
        final Config config = bsrc.getConfig();
        if (islandscape) {
            if ((float) srcw / (float) srch >= 1.6666f) {
                final int tmp = srcw;
                srcw = srch;
                srch = tmp;
                final Bitmap bmOverlay = Bitmap
                        .createBitmap(neww, newh, config);
                final Canvas canvas = new Canvas(bmOverlay);
                final Matrix matrix = new Matrix();
                matrix.reset();
                matrix.setRotate(90, srcw / 2, srcw / 2);
                canvas.setMatrix(matrix);
                canvas.drawBitmap(bsrc, 0, (newh - srch) / screenCount, null);
                bsrc.recycle();
                return bmOverlay;
            } 
            final Bitmap bmOverlay = Bitmap.createBitmap(neww, newh, config);
            final Canvas canvas = new Canvas(bmOverlay);
            canvas.drawBitmap(bsrc, 0, (newh - srch) / screenCount, null);
            bsrc.recycle();
            return bmOverlay;
        } else { 
            if (srch != newh) {
                final int tmp = srcw;
                srcw = srch;
                srch = tmp;
                final Bitmap bmOverlay = Bitmap
                        .createBitmap(neww, newh, config);
                final Canvas canvas = new Canvas(bmOverlay);
                final Matrix matrix = new Matrix();
                matrix.reset();
                matrix.setRotate(90, srcw / 2, srcw / 2);
                canvas.setMatrix(matrix);
                for (int i = 0; i < screenCount; i++) {
                    canvas.drawBitmap(bsrc, i * srcw, 0, null);
                } 
                bsrc.recycle();
                return bmOverlay;
            } 
            final Bitmap bmOverlay = Bitmap.createBitmap(neww, newh, config);
            final Canvas canvas = new Canvas(bmOverlay);
            for (int i = 0; i < screenCount; i++) {
                canvas.drawBitmap(bsrc, i * srcw, 0, null);
            } 
            bsrc.recycle();
            return bmOverlay;
        } 
    } 
 
    public static Bitmap overlayTiled2(final int neww, final int newh,
Experience pair programming with AI  Get Codota for Java