While you can create a closed path to fit the surface and then fill it with a solid pattern (the filling rule does not matter for a simple rectangle), it would be easier to just use the context paint () method, which will fill the current area of the clip (initially set to the entire surface) . It is important to do this before drawing the borders of the map / coast and filling them so that they are on top of the background.
source
share