T O P I C R E V I E W |
DK1970 |
Posted - Aug 14 2024 : 07:58:17 Hello. I am using ImageEnView. At runtime, when I click on the ImageEnView, Can I know the coordinates of ImageEnView.IECanvas? Please let me know how to do this.
Daisuke Kazama |
3 L A T E S T R E P L I E S (Newest First) |
DK1970 |
Posted - Aug 15 2024 : 23:14:14 Thank you very much. You've been very helpful.
Daisuke Kazama |
xequte |
Posted - Aug 15 2024 : 17:00:54 Hi
Although the Mouse position is not passed in click events, you can get the global mouse position:
https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.Controls.TMouse.CursorPos
But as Heartware stated, you should use the MouseUp event which includes a click position, which you can convert to Bitmap/Canvas coordinates using:
http://www.imageen.com/help/TImageEnView.XScr2Bmp.html http://www.imageen.com/help/TImageEnView.YScr2Bmp.html
Nigel Xequte Software www.imageen.com
|
HeartWare |
Posted - Aug 15 2024 : 03:48:13 You don't get coordinates in OnClck - you'll have to trap OnMouseUp (always use Up and not Down unless you have specific reasons. Why? Because that's how Windows does it. Try clicking and holding mouse down on a button - you only get the OnClick event once you release the mouse button, and only if the mouse is still within the button's surface. The same with Menus and other click-to-select items).
IIRC there's a setting in the properties of the TImageEnView where you can specify if the coordinates are bitmap-relative or component-relative. |