I replace a specific color in the image with this code:
procedure TformMain.ButtonDoReplaceColorClick(Sender: TObject);
begin
ImageEnViewPixelEditor.Proc.CastColorRange(
TColor2TRGB(PanelReplaceColorsPickedColor.Color), // OldColor
TColor2TRGB(PanelReplacementColor.Color), // NewColor
TrackBarColorReplacementTolerance.Position); // Tolerance
end;
Now I would like to limit the replacement to the area inside the current selection (if any). How could this be done?