Got it, if anyone is interested, here's the code to find all pixels inside a circle:
static List
<Vector2f
> FindPixelsOnSprite
(CircleShape c, Sprite s
) { List
<Vector2f
> results
= new List
<Vector2f
>(); float radius
= c
.Radius; float width
= s
.TextureRect.Width; float height
= s
.TextureRect.Height; float circleCenterX
= c
.Position.X - s
.Position.X; float circleCenterY
= c
.Position.Y - s
.Position.Y; List
<Vector2f
> pixels
= new List
<Vector2f
>((int)(width
* height
)); for (float iX
= 0; iX
< width
; iX
++) { for (float iY
= 0; iY
< height
; iY
++) { if (PixelInCircle
(circleCenterX, circleCenterY, radius, iX, iY
)) pixels
.Add(new Vector2f
(iX, iY
)); } } return pixels
; } private static bool PixelInCircle
(float circleCenterX,
float circleCenterY,
float radius,
float pixelX,
float pixelY
) { float dx
= circleCenterX
- pixelX
; float dy
= circleCenterY
- pixelY
; dx
*= dx
; dy
*= dy
; float distanceSquared
= dx
+ dy
; float radiusSquared
= radius
* radius
; return distanceSquared
<= radiusSquared
; }
After clicking, my program looks like this:
(http://i.imgur.com/ZYrbly6.jpg)
Next I have to find the distance of each pixel to the circle origin. :)