Posts with the tag rectangle:

How to Draw Rectangle on Imageview ?

If you already have a bitmap image in your code, just use this code snippet. bmp = bmp.copy(Bitmap.Config.RGB_565, true); That code will recreate the bitmap image as a mutable. So you can edit that bitmap image on canvas as you like. But if you do not have a bitmap image in code, create a new one using this code snippet. Bitmap bmp=Bitmap.createBitmap(img.getHeight(),img.getWidth(),Bitmap.Config.RGB_565); where img is another bitmap image you want to make a new one with the height and width of it. If you want to create one from scratch here is the code snippet. Bitmap bmp=Bitmap.createBitmap(400,700,Bitmap.Config.RGB_565); After that, create a canvas and pass the bitmap image you have.