How to cut ellipse in to four regions.
-
I am drawing an ellipse in a rectangle... I have to cut into four parts I need the region of that so that i can fill the color individually in thoes region. To make it more clear If we divide the ellipse into four quarters. then i should know the region and i want to fill them with different color.
-
I am drawing an ellipse in a rectangle... I have to cut into four parts I need the region of that so that i can fill the color individually in thoes region. To make it more clear If we divide the ellipse into four quarters. then i should know the region and i want to fill them with different color.
-
I am drawing an ellipse in a rectangle... I have to cut into four parts I need the region of that so that i can fill the color individually in thoes region. To make it more clear If we divide the ellipse into four quarters. then i should know the region and i want to fill them with different color.
You could use GDI+ FillPie function. Just get the bounds of the ellipse, ie
void Draw( int px, int py, int xRadius, int yRadius )
{
Graphics *g = ....
Rect rcBnds( px, py, xRadius*2, yRadius*2 );
Brush *brColor = first color;
// Draw lower right
g->FillPie( brColor, rcBnds, 0, 90 );
brColor = second color;
g->FillPie( brColor, rcBnds, 90, 180 );
brColor = third color;
g->FillPie( brColor, rcBnds, 180, 270 );
brColor = last color;
g->FillPie( brColor, rcBnds, 270, 360 );
}Of course you can use regular GDI and Pie(), you just have to calc the points yourself, which is easy since you are just dividing into 4 parts.