I'm new to this forum, I have searched through several sections already in the forum before I registered to find an answer. I can't find the answer on my question. Here it is. I'm making a GUI form in Borland and I have inserted an image there.
When I move my mouse over that image, the X and Y coordinates of the mouse position should appear in two edit boxes.
I know I have to do that with the OnMouseMove Event, but I don't know how. Can anybody give me a help on that? I have no code made yet, due to this issue.
I have found it already. After all it seemed to be quite simple :)
I have figured out the code below and it works, only I still have to find out how to give the coordinates of the image and not the whole screen.
1 2 3 4 5 6 7 8
struct point {int x; int y;};
POINT pos;
GetCursorPos(&pos);
this->Edit1->Text = (pos.x);
this->Edit2->Text = (pos.y);
I will show you the whole code. The program should determine the position of the mouse, when you hoover over an image and put it in two editboxes. When you click the record button first, and then click on a position on the image, it will store the position of the mouse in a vector. Then when you click the play button all the stored positions will become visible after each other on the image in red.
I have fixed the problem of determining the position of the mouse, but...now I can't make it visible on the image when I press the playbutton.
Anybody got a clue how to do this?? I assume it has to do with the void __fastcall TForm1::buttonReverseClick(TObject *Sender) function but I can't figure out what the parameters of the ellipse should be?