Reputation: 780
How can I create an ImageView programmatically and draw on canvas in Android?
I also saw this post of-canvas and tried the below code:
ImageView img = new ImageView(HighScore.ctx);
img.setImageResource(R.drawable.interactive);
img.draw(canvas);
img.bringToFront();
img.invalidate();
img.draw(canvas);
But the answer doesn't seem complete, it's not working. plz can anybody help me..
Upvotes: 1
Views: 777
Reputation:
Refer to this link: http://developer.android.com/reference/android/widget/ImageView.html#lattrs
Here equivalent methods of xml attributes for imageview are given.
Upvotes: 1