I have a Bitmap and I want to draw circle or square on it.
Do I need to use canvas or there is possibility to draw on Bitmap?
I have a Bitmap and I want to draw circle or square on it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use
Canvasto draw data into aBitmapinstance, simply by creating aCanvasinstance and passing theBitmapto the constructor. However, theBitmapmust be mutable or you will not be able to edit its pixel data. By default, anyBitmapcreated by loading an image file, etc. is immutable. You will likely need to use one of the versions ofBitmap.createBitmap()that takes the original as a parameter in order to make a mutable copy you can draw on top of.