Working with Android Bitmaps: Creation, Loading, and Rendering
Creating a New Bitmap Instance
A fresh bitmap can be alloacted by specifying dimensions and a pixel configuration. Here, a mutable 24-bit RGB image without an alpha channel is generated:
int canvasWidth = 400;
int canvasHeight = 300;
Bitmap mutableBitmap = Bitmap.createBitmap(canvasWidth, canvasHeight, Bitmap.Config.RGB_565);
The RGB_565 confi ...
Posted on Sun, 04 Oct 2026 16:13:16 +0000 by sankaty