Answer the question
In order to leave comments, you need to log in
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
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);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question