Converting a canvas into bitmap image in android?

Advice depends upon what you are trying to do If you are concerned that your controls take a long time to draw, and you want to draw to a bitmap so you can blit the bitmap rather than re-drawing via a canvas, then you don't want to be double-guessing the platform - controls automatically cache their drawing to temporary bitmaps, and these can even be fetched from the control using getDrawingCache() If you want to draw using a canvas to a bitmap, the usual recipe is: Create a bitmap of the correct size using Bitmap.createBitmap() Create a canvas instance pointing that this bitmap using Canvas(Bitmap) constructor Draw to the canvas Use the bitmap.

Advice depends upon what you are trying to do. If you are concerned that your controls take a long time to draw, and you want to draw to a bitmap so you can blit the bitmap rather than re-drawing via a canvas, then you don't want to be double-guessing the platform - controls automatically cache their drawing to temporary bitmaps, and these can even be fetched from the control using getDrawingCache() If you want to draw using a canvas to a bitmap, the usual recipe is: Create a bitmap of the correct size using Bitmap.createBitmap() Create a canvas instance pointing that this bitmap using Canvas(Bitmap) constructor Draw to the canvas Use the bitmap.

Bitmap myBitmap = new Bitmap((int)Width, (int)Height. With width and height being the same as your canvas. Next, use canvas.

SetBitmap(myBitmap), but not drawBitmap(). After you call setBitmap, all what you draw on canvas is in fact, drawing on your myBitmap going by the example code I have illustrated.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions