Author Topic: getting mouse coordinates in a scrip, is it possible?  (Read 4110 times)

Offline gvanhau

  • PixInsight Old Hand
  • ****
  • Posts: 345
getting mouse coordinates in a scrip, is it possible?
« on: 2013 January 29 10:14:15 »
Hello

Is possible to obtain the coordinates of the mouse within an image during the execution of a script?

Regards
Geert
Geert Vanhauwaert

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: getting mouse coordinates in a scrip, is it possible?
« Reply #1 on: 2013 January 29 14:39:23 »
Hi Geert,

Direct user interaction with image windows is not possible from scripts, since script dialogs are modal. PixInsight 1.8 introduces the new ImageView component:

http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1ImageView.html

ImageView allows embedding an image browser, with the same functionality as an image window, in any control. Unfortunately, ImageView is only available to PCL for now. A PJSR implementation is still not available, but it will be soon after the 1.8.0 release.

If the tasks that you're going to implement are relatively simple, a possible solution may be a ScrollBox to browse a Bitmap representation of the image. Like any Control, a ScrollBox can receive and handle mouse events.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/