I just now wrote this function that can be called from OnMouseMove:
function TformMain.IsMouseWithinImageBoundaries(const X, Y: Integer): Boolean;
Result := False;
var bx := ImageEnView1.XScr2Bmp(X, False);
var by := ImageEnView1.YScr2Bmp(Y, False);
if (bx >= 0) and
(bx < ImageEnView1.IEBitmap.Width) and
(by >= 0) and
(by < ImageEnView1.IEBitmap.Height)
then Result := True;
I think it should be declared as inline?
Is this correct? Is there a better/shorter way to detect this?