Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a custom tool for moving features that implements IDisplayFeedback and geometry-specific CoClasses to show the user where they are moving the feature.

    IMovePolygonFeedback polygonFeedback;
    bool feedbackStarted;

    public override void OnMouseDown(int Button, int Shift, int X, int Y)
    {
        feedbackStarted = false;

        //A BUNCH OF STUFF HERE TO SELECT A FEATURE ON MOUSEDOWN

        geometry = feature.Shape;

        polygonFeedback = new MovePolygonFeedbackClass();
        polygonFeedback.Display = doc.ActiveView.ScreenDisplay;
        polygonFeedback.Start(geometry as IPolygon, doc.CurrentLocation);
        feedbackStarted = true;
    }

    public override void OnMouseMove(int Button, int Shift, int X, int Y)
    {
        IPoint point = doc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
        if (polygonFeedback != null && feedbackStarted)
            polygonFeedback.MoveTo(point);
    }

What sometimes happens when the mousedown and mousemove happen quickly is that the feedback display stutters for a second, leaving a (what I assume to be) graphic, then continues on with a new graphic moving around with the mouse until mouseup. Looks kinda like this:

http://i.imgur.com/99fj8.png

At mouseup I change the feature shape to the new position and store the feature. I union the original feature extent with the new feature extent and pass that envelope to a partial refresh. Problem is sometimes parts of the "stutter" aren't in that envelope so I get dangly bits:

http://i.imgur.com/v1oxx.png

I'm trying to avoid straight refreshes but these dangly bits are not pretty and don't go away until a refresh happens (forced by user or move/pan, etc.)

Questions:

  1. Does anybody know why the "stutter" is happening and how can I prevent it?
  2. Is there a way to partially refresh the dangly bits?
  3. What is the feedback? Is it a graphic? Can I trap it during the onmove to add it to the partial refresh envelope?
  4. Is there an infintely better way to do this that I'm mising?

Help!

share|improve this question
1  
D.Dillard, your symbol is correctly setted for this kind of operations? The ROP style can give glitches of this kind. Try setting it for esriRasterOpCode.esriROPNotXOrPen. –  George Jul 23 '11 at 18:01
    
@George, good point - I have noticed this with the Flash Geometry snippet, it leaves the outline of polygon features because they forgot to set the esriROPNotXOrPen style for the outline symbol. –  blah238 Aug 12 '11 at 6:54
    
@blah238 happens to me quite often :P. remember to set the outline symbol rop! –  George Aug 12 '11 at 17:15

1 Answer 1

You might try calling IScreenDisplay.UpdateWindow() within your OnMouseMove method, may not work at all but it's an easy thing to try.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.