A
A
Alexander Shilov2016-03-07 20:57:39
C++ / C#
Alexander Shilov, 2016-03-07 20:57:39

How to get the coordinates of an Image point?

Good evening. Can you please tell me how to make it so that when you click on Image in Edit1, a point is displayed in X, and in Edit2 a point is displayed in Y?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shilov, 2016-03-07
@Tabbols

Sorry, found the answer here .

void __fastcall TForm1::Image1Click(TObject *Sender)
{
TPoint tp;
GetCursorPos(&tp);
int x=int(tp.x);
int y=int(tp.y);
Edit1->Text=IntToStr(x-10);
Edit2->Text=IntToStr(y-20);
}

This thing worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question