Erase area within clipped path

WAZUMBi

Well-Known Member
Licensed User
Longtime User
I don't seem to be able to fill a clipped area with a transparent color.


if i clip a path for example:
B4X:
mainPath.Initialize(mainRect.CenterX, mainRect.Top)
mainPath.LineTo(mainRect.Right, mainRect.CenterY)
mainPath.LineTo(mainRect.CenterX, mainRect.Bottom)
mainPath.LineTo(mainRect.Left, mainRect.CenterY
mainPath.LineTo(mainRect.CenterX, mainRect.Top)
cvs.ClipPath(mainPath)

and then try and fill it with a color.. Any color works:

mainDrawable.Initialize(Colors.Red, 0)
cvs.DrawDrawable(mainDrawable, mainRect)


But I can't fill it with transparent:
mainDrawable.Initialize(Colors.Transparent, 0)
cvs.DrawDrawable(mainDrawable, mainRect)


I need to erase an area within a clipped path. Say in the shape of a diamond, pentagon, hexagon....

Doing so with

cvs.DrawRect(mainRect, Colors.Transparent, True, 1)

or

cvs.DrawCircle(mainRect.CenterX, mainRect.CenterY, gridData.radius, Colors.Transparent, True, 1)

work fine for a square or a circle.

Any other ideas how to accomplish this within a irregular shaped clipped path?
 

WAZUMBi

Well-Known Member
Licensed User
Longtime User
Yep that worked. :sign0060:
Guess I was tring to make it more complicating then it needed to be.
 
Upvote 0
Top