Image control mouse move event updates

I would like to drag the ROI around in the Image control (holding down the left mouse button) and continually read out the ROI coordinates. I can't find a way to do this: the mouse move event does not seem to fire if I hold the left mouse button down. I assumed that I would have
1. Mouse down when I click and hold.
2. Mouse move when I move the ROI around.
3. Mouse up when I release the left mouse button.
This does not seem to be the case.
I've done a simple workaround which is
1. Use the key up event to check that the space bar has been pressed.
2. Use this to toggle a "lock" boolean which locks the target to the mouse coordinates.
3. Use the mouse move event to return the Image Control Mouse Coordinates property.
4. Unlcok the target from the mouse coordinates by pressing the space bar again.
This kind of works, but it is much less intuitive than the standard windows "click and drag".
Any comments appreciated.
Thanks.
PS The Image Control is excellent, it has saved me lots of development time. Also, the ROI tools are hugely useful.

If you filter the mouse down event (MOUSE DOWN?) then the coordinated are always returned on mouse move event weather the mouse is down or not.  I did get the coordinates when the left button was down anyway it was just when the right button was down which the move event was not handled (due to the popup menu consuming the event first?)  I thing there is a good way to do this with dynamic event registration, and NI has a similar example of drag and drop of controls, but I am not at my LV machine to look for it right now.  If I am wrong I am sorry it is early and my coffee is not brewed yet.
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Similar Messages

  • How to execute a method on mouse move event on an Image

    Hi All,
    I want to execute a method on mouse move event or mouse click event to an image.
    how can i achieve this?
    TIA,
    Vishal

    I am not sure if commandImageLink or goImageLink solve your requirement.
    But as a workaround you can use set of ClientListener and ServerListener with af:image to achieve what you need.
    using then you can capture client event and convert that into server event which you can use to call a bean method.
    Inside this bean you can call a web service or method binding.
    My first link in previous post shows that very well....
    OR
    http://naive-amseth.blogspot.com/2011/02/calling-methodbindingwebservice-on.html
    Amit
    Edited by: amseth on Feb 15, 2011 12:25 AM

  • XY graph "mouse move" event stops generating when click on cursor

    Hello All
    When the mouse is moving freelly inside the XY graph control, the "mouse movement" event is fired.
    The same happens when muse clicks anywhere in the graph with the exception of cursors.
    hen mouse clicks on cursors the "mouse move" event is NOT generated even though the mouse is phisically moved.
    Is there any explanation to this.
    I enclose the example.
    regards
    Pawel

    Just today I had the same problem -> my solution:
    set event timeOut to some value(I have it at 1ms) then
    add to globalVariables some BOOL variable that will signal if mouse is down or up (set the flag in appropriate event),
    then add a case in the timeOut event which will read this
    global variable(flag) -> if it's TRUE then change the needed parameter.
    So even if the mouse move event isn't fired the main timeout event is.
    Not a perfect solution, but better than nothing.
    Peace
    Waldemar

  • Mimicking mouse move event

    Hi,
    I'm using flex through a plugin, and not though a browser (like most people do). For some strange reason my flex SWF doesn't receives mouse move events. I can get the mouse move events in the application that contains the SWF, and I can tell the SWF that the events has occured, using the externalInterface API.
    Once I received a call that indicates a new mouse position, I want to mimick it as a normal mouse move event. Any ideas on a simple way to do this?
    thanks in advance,
    Vince

    If you have the stage coordinates of the mouse, you can get pretty far by calling getObjectsUnderPoint and dispatching a MouseEvent from the last element in the array (converting the stage coordinates to local).
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Dynamically register "mouse move" event for a VI

    Just as in the example ”Dynamically Register for Events.vi” I want to dynamically register a “Mouse Move” event. I use the “Open VI Reference” to get the reference to the VI and I connect it to the “Register For Events” block just as in the example. When I click the block I get a list of events to choose from, but the “mouse move” event is not one of them. How do I select this event?
    I have got the program running by copying the “Register For Events” block from the example and into my program, but I’m interested to know how this should have been done.
    I use LabView 8.0

    I've had the same problem in LV 8.2.1 and 8.5. I found that NI changed how to access the mouse move... it's now available under "Pane." See my attached example, a modified NI Example.
    Derek
    Attachments:
    Dynamically Register for Events - 8X.vi ‏44 KB

  • Mouse move event when mouse out of stage.

    Hi
      I'm wondering how is this task done that listen to mouse move event when user cursor is out of stage?

    Hi, kennethkawamoto2
        I've tried in this way: use "stage.mouseX, stage.mouseY" these two values when cursor is out of stage, and it worked quite well till now,
    If you mind discribe the issue that you've metion that " Flash does not report mouse location correctly beyond stage.." more in detail, I think I should avoid this. Thank you very much!

  • Imported image's position moves when updated in Indesign CS6. Why??

    After modifying an imported image from illustrator, the imported image's position moves within the frame of Indesign CS6 when the link is updated.

    You have not provided any relevant information, so nobody can know. you can simply have added content that expands the bounding box. Well, whatever, ask in the relevant forums and be much more specific.
    Mylenium

  • How can I (neatly) control mouse click events in a multi-dimensional array?

    Hello everyone!
         I have a question regarding the use of mouse clicks events in a multi-dimensional array (or a "2D" array as we refer to them in Java and C++).
    Background
         I have an array of objects each with a corresponding mouse click event. Each object is stored at a location ranging from [0][0] to [5][8] (hence a 9 x 6 grid) and has the specific column and row number associated with it as well (i.e. tile [2][4] has a row number of 2 and a column number of 4, even though it is on the third row, fifth column). Upon each mouse click, the tile that is selected is stored in a temporary array. The array is cleared if a tile is clicked that does not share a column or row value equal to, minus or plus 1 with the currently targeted tile (i.e. clicking tile [1][1] will clear the array if there aren't any tiles stored that have the row/column number
    [0][0], [0][1], [0][2],
    [1][0], [1][1], [1][2],
    [2][0], [2][1], [2][2]
    or any contiguous column/row with another tile stored in the array, meaning that the newly clicked tile only needs to be sharing a border with one of the tiles in the temp array but not necessarily with the last tile stored).
    Question
         What is a clean, tidy way of programming this in AS3? Here are a couple portions of my code (although the mouse click event isn't finished/working correctly):
      public function tileClick(e:MouseEvent):void
       var tile:Object = e.currentTarget;
       tileSelect.push(uint(tile.currentFrameLabel));
       selectArr.push(tile);
       if (tile.select.visible == false)
        tile.select.visible = true;
       else
        tile.select.visible = false;
       for (var i:uint = 0; i < selectArr.length; i++)
        if ((tile.rowN == selectArr[i].rowN - 1) ||
         (tile.rowN == selectArr[i].rowN) ||
         (tile.rowN == selectArr[i].rowN + 1))
         if ((tile.colN == selectArr[i].colN - 1) ||
         (tile.colN == selectArr[i].colN) ||
         (tile.colN == selectArr[i].colN + 1))
          trace("jackpot!" + i);
        else
         for (var ii:uint = 0; ii < 1; ii++)
          for (var iii:uint = 0; iii < selectArr.length; iii++)
           selectArr[iii].select.visible = false;
          selectArr = [];
          trace("Err!");

    Andrei1,
         So are you saying that if I, rather than assigning a uint to the column and row number for each tile, just assigned a string to each one in the form "#_#" then I could actually just assign the "adjacent" array directly to it instead of using a generic object to hold those values? In this case, my click event would simply check the indexes, one at a time, of all tiles currently stored in my "selectArr" array against the column/row string in the currently selected tile. Am I correct so far? If I am then let's say that "selectArr" is currently holding five tile coordinates (the user has clicked on five adjacent tiles thus far) and a sixth one is being evaluated now:
    Current "selectArr" values:
           1_0
           1_1, 2_1, 3_1
                  2_2
    New tile clicked:
           1_0
           1_1, 2_1, 3_1
                  2_2
                  2_3
    Coordinate search:
           1_-1
    0_0, 1_0, 2_0, 3_0
    0_1, 1_1, 2_1, 3_1, 4_1
           1_2, 2_2, 3_2
                  2_3
         Essentially what is happening here is that the new tile is checking all four coordinates/indexes belonging to each of the five tiles stored in the "selectArr" array as it tries to find a match for one of its own (which it does for the tile at coordinate 2_2). Thus the new tile at coordinate 2_3 would be marked as valid and added to the "selectArr" array as we wait for the next tile to be clicked and validated. Is this correct?

  • BUG mouse move event on stage in fullscreen

    Hi everybody,
    I have a video player witch can use fullscreen mod, when user click on fullscreen button, player switch in this mod, so, when user move his mouse on stage, playerControls appear.
    My problem :
    on Windows : in enterFullscreen event handler, i listen MOUSE_MOVE event on stage, the problem is that the MOUSE_MOVE is fire, even if the user doesn't move mouse, mouse coordinate change, yes, but i think mouse_move event should be not fire...
    the problem not appear on Mac.
    Sorry for my bad english.
    stage.addEventListener(FullScreenEvent.FULL_SCREEN, onEnterFullscreen);
    public function onEnterFullscreen(e:FullScreenEvent):void {
         stage.addEventListener(MouseEvent.MOUSE_MOVE,moveHandler);
    public function moveHandler(e:MouseEvent):void {
    Thanks in advance for your help

    Could you please open a new bug report on this over at bugbase.adobe.com?  When adding the bug, please include sample code or an application so we can quickly test this out internally.  If you'd like to keep this private, feel free to email the attachment to me directly ([email protected]). 
    Once added, please post back with the URL so that others affected can add their comments and votes.
     

  • Dynamicall​y register event mouse move

    I try to understand dynamically register for events.
    In this NI example of "Dynamically register for events.vi",  the first register events (outside the while loop), if I change the top item "mouse move" to something else, I cannot select "mouse move" event anymore, in the pull down arrow, there is not a "mouse move" as a selectable item. 
    Can anybody explain this?  I have to close VI without saving.
    When I make change to the event, in the event structure, there will be a case "unknown event" displayed.
    My other question is: how does the program knows the difference between mouse outside the picture control?
    I know that when I press the mouse button down on the picture then the iteration starts to count,  I just don't understand how the program knows the difference, it is not obvious to me.
    regards

    You should try working with standard events before using dynamic events.
    As for your questions:
    The dynamic events available in the event structure are determined by the dynamic event terminal (inside the right red square in the image below). When you change the Mouse Move event, it is no longer available and you have to configure the event structure to use another event.
    The Mouse Up and Mouse Down? events are registered for all the controls (left red square), so clicking on any control would generate those events.
    There should be a tutorial on this site about using dynamic events. You can use the search engine to find it. Also, reading the LabVIEW help on this is a good idea.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!
    Attachments:
    Dynamically Register for Events.png ‏6 KB

  • Event Precedence - Mouse Move or Cursor Move on Graph?

    Since LabVIEW 8+ introduced cursor events (grab, move, release), is there a conflict that would occur between a mouse move event and cursor move event since a cursor move involves a mouse move?  Or, since the cursor move requires the left mouse button to be down, does that allow LabVIEW to differentiate which event is occurring?  I have some code I am writing to draw a box on an intensity graph (using the new plot.images property for graphs) so as to extract a region of interest.  At first, I want a cursor to follow the mouse as it moves over the graph.  Then, I want to draw the box region when I grab the cursor (with left mouse key down) and drag it.  Differentiation of these two event types will allow me to unambiguously accomplish this task.
    Thanks,
    Don

    Moving a cursor will interleave mouse move and cursor move events.
    However, you can easily keep state of mouse up/down to distinguish what to do in this particular case. See attached draft (8.20).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    eventqueue1.vi ‏29 KB

  • Problem of imaq image control events

    Hi,
    I use CVI 2010 and NI Vision 2010 to develop a motion and machine vision system.
    I got a problem of using the imagecontrol, I can not capture the EVENT_KEYUP,EVENT_KEYPRESS and EVENT_LEFT_CLICK, EVENT_LEFT_CLICK_UP in the image control's callback.
    I also tried to use the function of InstallWinMsgCallback (g_hMainPnlHdl,WM_KEYUP,KeyupCallback,VAL_MODE_INT​ERCEPT,NULL,&hKeyupCbHdl) to install the WM_KEYUP event, the message is captured when the mouse pointer is outside of the image control,but when the mouse pointer entering the image control, the WM_KEYUP  event is missing. I think the image control has intercepted and blocked these messages.
    Anyone can help me? Thank you very much!
    Awen

    It seems to work for me.  I just tested EVENT_LEFT_CLICK and had the event increment a numeric each time it fired.  I just configured a callback function called "ImageCallback" in the Image control properties, then created a callback function.  I have attached the whole project below.
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Image Control Callback.zip ‏553 KB

  • Plz Help! How to control mouse motion(use program to move/click the mouse)?

    Hi people, plz give me some help on this: I wanna control mouse motion at another program's window, eg. control mouse movement in Internet Explorer's window. For a particular pixel on the screen, I need to move the mouse onto it instantly, then click. Please note that the java program(no applet) is going to run at the background, the current active window is some other programs like IE, notepad, etc.
    Plz give me some clue about how to achieve this, thanks.
    Do I need to do this through windows API or it can be done purely in JAVA?
    Also, how to calculate the RGB color from a particular pixel on the screen?
    Thank you very much for your time, plz help :).

    The same question each day (exe) !!!
    There are many posts on this point!
    All the soft that allows the build a native executable file on Windows
    are not free!
    You can take a look at JET excelsior
    http://www.excelsior-usa.com/home.html
    Denis

  • Cursor move event dicrease frequency

    Hello!
    A long time ago I remember I saw a forum post or a community doc, where it was explained how to decrease a certain Event to be triggered too frequently.
    I have a graph with a cursor, and when the user starts to move the cursor, I do some minor calculations and output some values into indicators. I would like to discard some of the "mouse move" events, so when the user pulls the cursor "too fast", I do not overload the CPU with processing. I know I could just use the "cursor release" event, but it is not that nice, the user does not get feedback about the values between the two locations.
    So I cannot really remember what was the trick to discard the too frequent triggering, it involved some time stamp comparison I think...
    Could someone help me out, how to properly solve this task?
    thanks!
    Solved!
    Go to Solution.

    In newer LabVIEW version you can limit the size of the event queue. Try this first. (See this completed idea).
    In earlier version I would compare the current cursor position with the position obtained from a property node and execute an empty case structure unless they are equal. The old discussion is here. (Also make sure to disable "lock front panel until event completes").
    The cursor idea in in this reply, see the right side of the following image.
    LabVIEW Champion . Do more with less code and in less time .

  • How to use touch start, touch move, mouse down, mouse move to move elements in edge

    How to use touch move and mouse move events events to move elements n edge?

    Here is my code for a vertical carousel for mouse and touch interaction.  it's not perfect, but it does the job.  change from Y to X for horizontal path.  past at Stage.compositionready event.
    // these are my elemens
    var temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
    var temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
    var temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
    var temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
    var temp5 = sym.getSymbol("vmenu2").$("info").position().top;
    var temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
    var temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
    var temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
    var temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
    var tempa = sym.getSymbol("vmenu2").$("tvchannels").height();
    var tempb = 200;
    var tempdiff = temp2 - temp1;
    var y1=0;
    var y2=0;
    var t = 0;
    $(document).bind("touchstart", function(e) { 
      e.preventDefault(); 
      y1 = e.originalEvent.touches[0].pageY;
      temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
      temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
      temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
      temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
      temp5 = sym.getSymbol("vmenu2").$("info").position().top;
      temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
      temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
      temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
      temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
      t = 1;
    $(document).bind("touchend", function(e) { 
      e.preventDefault(); 
      t = 0;
    $(document).bind("touchmove", function(e) { 
      e.preventDefault(); 
      //var x = e.originalEvent.touches[0].pageX;
      y2 = e.originalEvent.touches[0].pageY;
      //sym.getSymbol("vmenu2").$("tvchannels").css({top: y, left: x}); 
      if (t==1) {
        var y = y2 - y1; 
        var top1 = temp1 + y + tempdiff;
        var top2 = temp2 + y + tempdiff;
        var top3 = temp3 + y + tempdiff;
        var top4 = temp4 + y + tempdiff;
        var top5 = temp5 + y + tempdiff;
        var top6 = temp6 + y + tempdiff;
        var top7 = temp7 + y + tempdiff;
        var top8 = temp8 + y + tempdiff;
        var top9 = temp9 + y + tempdiff;
        if (top1<10) {
          if (top9>250) {
            sym.getSymbol("vmenu2").$("tvchannels").css({top: top1}); 
            sym.getSymbol("vmenu2").$("videosondemand").css(); 
            sym.getSymbol("vmenu2").$("radiochannels").css();
            sym.getSymbol("vmenu2").$("music2").css();
            sym.getSymbol("vmenu2").$("info").css();
            sym.getSymbol("vmenu2").$("vrtour").css();
            sym.getSymbol("vmenu2").$("weather").css();
            sym.getSymbol("vmenu2").$("clock").css();
            sym.getSymbol("vmenu2").$("settings").css();
    var d = 0;
    $(document).bind("mousedown", function(e) { 
      e.preventDefault(); 
      y1 = e.pageY;
      temp1 = sym.getSymbol("vmenu2").$("tvchannels").position().top;
      temp2 = sym.getSymbol("vmenu2").$("videosondemand").position().top;
      temp3 = sym.getSymbol("vmenu2").$("radiochannels").position().top;
      temp4 = sym.getSymbol("vmenu2").$("music2").position().top;
      temp5 = sym.getSymbol("vmenu2").$("info").position().top;
      temp6 = sym.getSymbol("vmenu2").$("vrtour").position().top;
      temp7 = sym.getSymbol("vmenu2").$("weather").position().top;
      temp8 = sym.getSymbol("vmenu2").$("clock").position().top;
      temp9 = sym.getSymbol("vmenu2").$("settings").position().top;
      d = 1;
    $(document).bind("mouseup", function(e) { 
      e.preventDefault(); 
      d = 0;
    $(document).bind("mousemove", function(e) { 
      e.preventDefault(); 
      //var x = e.originalEvent.touches[0].pageX;
      y2 = e.pageY;
      //sym.getSymbol("vmenu2").$("tvchannels").css({top: y, left: x}); 
      if (d==1) {
        var y = y2 - y1; 
        var top1 = temp1 + y + tempdiff;
        var top2 = temp2 + y + tempdiff;
        var top3 = temp3 + y + tempdiff;
        var top4 = temp4 + y + tempdiff;
        var top5 = temp5 + y + tempdiff;
        var top6 = temp6 + y + tempdiff;
        var top7 = temp7 + y + tempdiff;
        var top8 = temp8 + y + tempdiff;
        var top9 = temp9 + y + tempdiff;
        if (top1<10) {
          if (top9>250) {
            sym.getSymbol("vmenu2").$("tvchannels").css({top: top1}); 
            sym.getSymbol("vmenu2").$("videosondemand").css(); 
            sym.getSymbol("vmenu2").$("radiochannels").css();
            sym.getSymbol("vmenu2").$("music2").css();
            sym.getSymbol("vmenu2").$("info").css();
            sym.getSymbol("vmenu2").$("vrtour").css();
            sym.getSymbol("vmenu2").$("weather").css();
            sym.getSymbol("vmenu2").$("clock").css();
            sym.getSymbol("vmenu2").$("settings").css();

Maybe you are looking for

  • Search help for table control input value

    Hi, We have designed a GUI for supply invoice approval workflow with table control. In the table control fields, we assigned one search help on one field. We can enter the values(F4 Help) up 8 row in the default screen, which is having 8 row. After s

  • I have hp pavilion dv6-6080se my recovery removed help

    my notebook recovery (pavilion dv6-6080se) removed 

  • Unable to create a page under particular page/node

    Hi, I have deployed some contents from some other CQ server to my local. I am not able to create pages under lot of page/ nodes though I have all permission(admin). The options for creating a new page are read-only and when i open that page , the pag

  • Creating Scatter chart for more than one column

    Hi, I have 2 columns of sorted numbers, when I select one column at a time and create a Scatter type chart, every thing is OK, But I want a chart with both columns in it, and when I select both columns and select a Scatter chart, Numbers takes the Gr

  • IDOC--XI--IDOC Using ABAP MAPPING

    Hi all, My requirement is to map source IDOC fields to target IDOC fields using ABAP Mapping. few fields in source idoc structure has to be merged into a single field in target idoc structure. need help on how to start with as i am not exposed to ABA