Question

I want to fill a slice of a rectangle based upon a value which doesn't correlate to the degree of the rectangle that needs to be filled.

Say this square below, I would want the area that is light gray to get bigger and bigger (Like a slice of a pie getting bigger) until the entire square is light gray.

A picture of a square

How would I go about doing this using System.Drawing? I tried using FillPie but it doesn't fill the square corners

Was it helpful?

Solution

Set the Graphics.Clip property to a region that represents the rectangle, then FillPie with an oversized radius such that the "pie" completely covers the rectangle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top