kumar
kumar

Reputation: 780

create ImageView programatically and draw on canvas android

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

Answers (1)

user4731855
user4731855

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

Related Questions