Obtain the coordinates of the mouse in the graphics objects

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Obtain the coordinates of the mouse in the graphics objects

#1 Post by Eugene Lutsenko »

Is it possible to click the mouse cursor on the image of the graphic to get the coordinates of the cursor inside it in pixels? If possible, how to do it?

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Obtain the coordinates of the mouse in the graphics obje

#2 Post by rdonnay »

oStatic:lbClick := {|a,b,o|aCoords := b}
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Obtain the coordinates of the mouse in the graphics obje

#3 Post by Tom »

To track cursor position with any move over the object:

Code: Select all

@ x,y DCSTATIC ... EVAL {|o|o:Motion := {|aPos|oPosObject:SetCaption(Str(aPos[1])+/Str(aPos[2]))}}

@ a,b DCSAY '' OBJECT oPosObject SIZE 20,1
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Obtain the coordinates of the mouse in the graphics obje

#4 Post by Eugene Lutsenko »

Somewhere I saw a simple graphical editor similar to Paint, made ​​in Alaska. And now could not find it. Tell me, please, where to find the source.

Post Reply