ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 mouse click on ImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

DK1970

Japan
4 Posts

Posted - Aug 14 2024 :  07:58:17  Show Profile  Reply
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

HeartWare

Denmark
49 Posts

Posted - Aug 15 2024 :  03:48:13  Show Profile  Reply
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.
Go to Top of Page

xequte

38459 Posts

Posted - Aug 15 2024 :  17:00:54  Show Profile  Reply
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
Go to Top of Page

DK1970

Japan
4 Posts

Posted - Aug 15 2024 :  23:14:14  Show Profile  Reply
Thank you very much. You've been very helpful.

Daisuke Kazama
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: