I have custom view and inside onDraw
I need to draw in canvas rectangle. I have RectF with all coordinates. And now I need to paint the entire area around the rectangle in a different color. Is it possible to do this using RectF ?
Please help me.
I have custom view and inside onDraw
I need to draw in canvas rectangle. I have RectF with all coordinates. And now I need to paint the entire area around the rectangle in a different color. Is it possible to do this using RectF ?
Please help me.
To color red the outside of a 400 pixel by 400 pixel rectangle in the center of a view you can do the following in
onDraw()
:This code assumes that the view is at least 400px by 400px.
See clipRect.