02-11-2012 12:25 PM
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).
Solved! Go to Solution.
02-11-2012 03:42 PM
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
02-13-2012 05:56 AM
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
02-13-2012 04:18 PM
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.
02-14-2012 02:59 AM
Thank you for your explanation!
I am afraid that this means that I will have to redesign my cursor coordinates.
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).