0

I have pretty complex custom ImageView and on the other hand I have Picture object that I want to draw it on the ImageView's canvas? Is this possible? The Picture object is not to be converted in any other type since then it'll lose quality and staff, that's why I go with Picture..

Thanks

Kara
  • 6,115
  • 16
  • 50
  • 57
Peter Olsbourg
  • 487
  • 2
  • 7
  • 12

1 Answers1

1

You have at least 2 options:

1 - Retriev bitmap from ImageView. Create canvas from it:

     Canvas canvas = new Canvas(mImage);

Draw on that canvas.

2 - Put transparent custom View/SurfaceView over ImageView and draw on it.

Maxim
  • 2,996
  • 17
  • 19
  • but then all the ImageView matrix transformations would not be applied to the canvas, would they? – Peter Olsbourg Aug 05 '11 at 13:39
  • It depends whether you receive canvas after or befor transformations – Maxim Aug 05 '11 at 13:47
  • If you set trnsformations in xml so the code will be called after setContentView and transformation will be already male befor you start drawing on canvas – Maxim Aug 05 '11 at 14:29
  • @Maxim How would I go on about doing option #2? I have an imageview which has letter on it and I want to allow user to practice writing over the image. – Si8 Aug 19 '13 at 14:06