I am using canvas to draw the Different colour.
I want to set the Image that should be appear as the background of the canvas. And while i am drawing on that image it should be drawn on the Image not behind the image.
Right now with below code it is drawing behind the Image.
@Override
public void run() {
Canvas canvas = null;
while (_run){
try{
canvas = mSurfaceHolder.lockCanvas(null);
canvas.drawColor(0, PorterDuff.Mode.CLEAR);
commandManager.executeAll(canvas);
} finally {
Bitmap kangoo = BitmapFactory.decodeResource(getResources(),R.drawable.icon);
canvas.drawBitmap(kangoo, 130, 100, null);
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
}
}
So what should i have to do to make drawing on the image ???
No one have giving me answer.
But i got solution, I have to set the image after clearing canvas.
code: