ImageEn, unit imageenproc

TImageEnProc.CastColor

TImageEnProc.CastColor


Declaration


procedure CastColor(BmpX, BmpY: Integer; newColor: TRGB; tolerance: Integer);


Description


Perform a flood-fill starting at the bitmap coordinates x, y, i.e. replacing all encountered pixels that match the color at the starting position with newColor.
tolerance specifies the maximum difference from the starting pixel (0 to 255, where 0 requires an exact color match, whereas 255 would match every color)


Example


// assuming X, Y = mouse coordinates, paints points to red
ImageEnView1.Proc.CastColor(ImageEnView1.XScr2Bmp(X), ImageEnView1.Yscr2Bmp(Y), CreateRGB(255, 0, 0), 0);


See Also


- Fill
- CastAlpha