Drawing a black rectangle doesn't do it.
I'm not shure if my explanations were clear enough.
Attached a new version of the test program.
- The Activity color is black.
- A transparent ImageView BG, covering the upper part of the screen, is on top of the activity with two colored background squares.
- A second transparent ImageView NB is on top of the previous one with 2 numbers.
- NumberON / OFF shows or hides the numbers
- Backgrnd ON / OFF shows or hides the backgrounds
- Set NB 1 sets number 1
- Clear NB 1 should clear number 1 (set to transparent) but doesn't
- Set BG 1 sets the red square
- Clear BG 1 should erase BG 1 (set to transparent) but doesn't
- Set NB 2 sets number 2
- Clear Nb 2 should clear number 2 (set to transparent) but doesn't
- Set BG 2 sets the green square
- Clear BG 2 should erase BG 2 (set to transparent) but doesn't
- T NB sets all numbers transparent
- T BG sets all background to transparent
What I want to do is to set either NB1, NB2, BG1 or BG to transparent.
Clicking onto Clear NB 1 sets Square around the number to black, acording to your proposal, but it covers the red rectangle and it is not transparent. The red rectangle should still be visible.
Clicking onto T NB for transparent number sets the whole ImageView to transparent, but it removes both numbers, so I need to redraw the number I didn't want to erase.
But I'm shure that with Bitmap.GetPixels(x,y,w,h) on the original bitmap and Bitmap.SetPixels(x,y,w,h) to erase would do it. Because the SetPixels function will replace the ImageView pixels and not draw onto it.
Best regards.