Code example for Bitmap

Methods: compresscopygetConfiggetHeightgetWidth

0
        // rotate the Bitmap 
        matrix.postRotate(degree, (arrow.getWidth() / 2), (arrow.getHeight() / 2));
        // recreate the new Bitmap 
        arrow = Bitmap.createBitmap(arrow, 0, 0, arrow.getWidth(), arrow.getHeight(), matrix, true);
 
        Bitmap b = picture.copy(picture.getConfig(), true);
        Canvas myCanvas = new Canvas(b);
 
        // and then just draw them on canvas 
        myCanvas.drawBitmap(arrow, (b.getWidth() - arrow.getWidth()) / 2 + scaledOffsetX, (b.getHeight() - arrow.getHeight()) / 2 + scaledOffsetY, new Paint());
 
        b.compress(CompressFormat.JPEG, 80, c.openFileOutput("arrowed.jpg", Context.MODE_PRIVATE));
        return b;
    } 
 
} 
Experience pair programming with AI  Get Codota for Java