Code example for Canvas

Methods: concatdrawARGBdrawBitmaprestoresavetranslate

        protected void onDraw(Canvas canvas) {
            canvas.drawARGB(255, 255, 255, 255);
            final float centerX = getWidth() / 2.0f - mBitmap1.getWidth() / 2.0f;
            final float centerY = getHeight() / 2.0f - mBitmap1.getHeight() / 2.0f;
            final Camera camera = mCamera;
            final Matrix matrix = mMatrix;
            rotate(centerX, centerY, camera, matrix, 32.0f);
            drawBitmap(canvas, centerX, centerY, 0.0f, matrix);
            rotate(centerX, centerY, camera, matrix, 12.0f);
            drawBitmap(canvas, centerX, centerY, -mBitmap1.getWidth(), matrix);
            rotate(centerX, centerY, camera, matrix, 52.0f);
            drawBitmap(canvas, centerX, centerY, mBitmap1.getWidth(), matrix);
            rotate(centerX, centerY, camera, matrix, 122.0f);
            drawBitmap(canvas, centerX, centerY, mBitmap1.getWidth() * 2.0f, matrix);
        private void drawBitmap(Canvas canvas, float centerX, float centerY, float offset,
                Matrix matrix) {
            canvas.translate(offset, 0.0f);
            canvas.drawBitmap(mBitmap1, centerX, centerY, null);
        private void rotate(float centerX, float centerY, Camera camera,
                Matrix matrix, float angle) {
Connect your IDE to all the code out there  Get Codota for Java