I have a facial recognition library working that gives me an array of rectangle. Right now I'm using this way to draw the rectangle.
foreach (Rectangle box in boxes)
{
for (int x = box.X; x <= box.X + box.Width; x++)
{
for (int y = box.Y; y <= box.Y + box.Height; y++)
{
outputbmp.SetPixel(x, y, Color.FromKnownColor(KnownColor.Red));
}
}
}
I'm looking for something as simple as:
Ellipse ellipse = new Ellipse(box); //cast rect to ellipse
outputbmp.DrawEllipse(ellipse);
which will look something more like:
where the outline of the ellipse touching the rectangle corners.
Based on the approach I used above, it is easy to draw a rectangle but for ellipse, it would require me to know all the points in the ellipse. Just wonder if there's anything to make my life easier.