I have a bitmap and I need to draw a circle on it. For now I've only drawn the pixels of the circumference. How can I get the other pixels without use the distance function that is expansive? This is my code
public void FindMostIntenityPixelInCircle(int x0, int y0, int radius, List<Point> intensities)
{
Bitmap bitmap = ((Bitmap)(_smartLabForm.pictureBoxGreenImage.Image));
int x = radius;
int y = 0;
int radiusError = 1 - x;
while (x >= y)
{
intensities.Add(new Point(x + x0, y + y0));
intensities.Add(new Point(y + x0, x + y0));
intensities.Add(new Point(-x + x0, y + y0));
intensities.Add(new Point(-y + x0, x + y0));
intensities.Add(new Point(-x + x0, -y + y0));
intensities.Add(new Point(-y + x0, -x + y0));
intensities.Add(new Point(x + x0, -y + y0));
intensities.Add(new Point(y + x0, -x + y0));
if (radiusError < 0)
{
radiusError += 2 * y + 1;
}
else
{
x--;
radiusError += 2 * (y - x) + 1;
}
}
}