LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ghost images of graph zoom rectangle

Solved!
Go to solution

Hello,

 

using the 'zoom to rectangle' style I have observed partial ghost images of the rectangles - it's even possible to 'paint' using these line fragments, see the attached screenshot. It happens both on Win XP and Win 7 (CVI2010).

 

zoom_rectangle.jpg

0 Kudos
Message 1 of 5
(3,394 Views)

I can add that it also happens for the X and Y range zoom style. I have not seen this effect in the example GraphZooming Smiley Frustrated

0 Kudos
Message 2 of 5
(3,391 Views)

OK,

 

realizing that this effect does not occur in the example GraphZooming was the first step to localize the problem - so far I did not manage to resolve the problem...


Here is the breakdown of my graph callback:

        switch ( event )
        {
            case EVENT_ZOOM:
                graph_zoom_pan = TRUE;
                break;
            case EVENT_LOST_FOCUS:
// change mouse cursor style, set text box visibility
                CursorCoordinatesDisplay ( FALSE );
                break;
            case EVENT_RIGHT_CLICK:
                ...
// adjust right click menu depending on graph_zoom_pan
                ...
  RunPopupMenu ();
                break;
            case EVENT_MOUSE_POINTER_MOVE:
                ...
// obtain cursor coordinates, display them in textbox, move textbox position to mouse cursor
                GetGraphCoordsFromPoint ();
                SetCtrlAttr (,,ATTR_LEFT, );
                SetCtrlAttr (,,ATTR_TOP, );
                ...
         }     
    return ( 0 );


If I comment out the two commands setting the position of the text box, everything behaves properly (except,of course, that the text box is not the the mouse cursor position...)
Obviously, the drawing of the text box may leave some traces while zooming...

Help is welcome...

 

Thanks,

Wolfgang

0 Kudos
Message 3 of 5
(3,362 Views)
Solution
Accepted by topic author Wolfgang

Hey Wolfgang,

 

The reason this is occurring is because when the zoom selection box is drawn, part of the box is drawn over the text box control. Then in between frames, the text box is moved. Next, the algorithm for the selection box erases the current selection box and draws the new selection box. The problem comes because now the part of the selection box that was over the text box control has moved. So the selection box algorithm attempts to erase a the line in the wrong spot and thus line is not erased.

 

Unfortunately, while this is a bug, we do not have many options for a better way to do this. We are going to look into possible ways to improve our algorithm for the selection box, but the algorithm is designed to avoid redrawing the graph as much as possible in order to improve performance. We will see what we can do and you can track this with known issue ID 337950.

 

The short of it is, avoid moving controls across the graph when using a zoom selection box.

National Instruments
0 Kudos
Message 4 of 5
(3,351 Views)

Thank you for your explanation!

 

I am afraid that this means that I will have to redesign my cursor coordinates.  Smiley Sad

I did like the idea to have a little box with the xy coordinates just below the cursor position (the cursor does not show up in screenshots).

 

coordinates.jpg

0 Kudos
Message 5 of 5
(3,347 Views)