"I should note that CastAlpha() may not work precisely the way you want it to."
Indeed - for the uninitiated, there seem to be unpredictable results:
Here is my original image (it already contains a transparent area):
Then I selected the arrow in the middle and applied this code to create another transparent area outside of the arrow:
imgMain.Proc.CropSel(True);
This is the result:
Then finally, I applied the code to color-flood-fill the transparent area I created in the last step, by clicking inside the top left corner:
imgMain.Proc.CastAlpha( imgMain.XScr2Bmp(X), imgMain.YScr2Bmp(Y), 255, 0, clBlue );
...which resulted in this artefact:
The result seems to be correct, as the flood-filling seems to have affected only the area with the same value of alpha transparency (created implicitly by my crop action by super-imposing an already existing transparency area - is this assumption correct?).
So is it also possible to influence the flood-filling with a Tolerance Value?