Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
serverinfo
Posted - Jan 21 2020 : 11:46:40 I am using the OnMouseDown and OnMouseUp of the Image component and need to know if the position the user clicked has a layer or not, and wich layer it is. Basically i need to do something when a user clicks a layer and do other stuff when the user click an area that has no layer under the mouse position.
// Show which layer is under the cursor
procedure TMainForm.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
lyr: Integer;
begin
lyr := ImageEnView1.FindLayerAt( X, Y );
if lyr < 0 then
lblLayer.Caption := 'Layer: None'
else
lblLayer.Caption := 'Layer: ' + IntToStr( lyr );
end;