Oct 15, 2013 at 5:14 AM
Edited Oct 15, 2013 at 5:14 AM
There are multiple flavors of the FloodFill method in that class. Assuming you got the coordinates right (you should check these by using local variables and checking their values in the debugger), you are trying to fill an area bounded by integer color
value of 255 with an integer color value of 100. Since the color format is something like ARGB - these values are basically different flavors of transparency.
To make it a bit more realistic you might want to do something like
var x = (int)e.GetCurrentPoint(img).Position.X;
var y = (int)e.GetCurrentPoint(img).Position.Y;
int boundingColor = Colors.Black.AsInt(); // this is an extension method from ColorExtensions that you can use to convert a Jupiter Color type to an int value
int fillColor = Color.FromArgb(255, 255, 0, 0).AsInt();
wb.FloodFill(x, y, boundingColor, fillColor);
To make it useful in a typical scenario you would need a different version of the method though and start by getting the color of the pixel where you start the filling operation:
var pbi = new PixelBufferInfo(wb.PixelBuffer);
int currentColor = pbi[x + y * wb.PixelWidth * 4];
byte threshold = 10;
wb.FloodFillScanlineReplace(x, y, currentColor, fillColor, threshold);
The threshold argument is optional and defines the maximum difference of any of the ARGB byte components of a single pixel can be from the currentColor value to be included in the filled region.