c# - Panning of a map is not smooth in winforms -


combining multiple small images *(256*256)* large image(dimensions of picturebox). if trying pan / move large image not moving until difference 256 pixels. not panning smoothly. here code

private void picturebox1_mousemove(object sender, mouseeventargs e) {     if (e.button == mousebuttons.right)     {         if (isdragging)         {             mapcenterx += (-e.x + (startingpoint.x)) * map.scalex;              mapcentery -= (-e.y + (startingpoint.y)) * map.scaley;              map.drawmap(mapcenterx, mapcentery, mapzoom);              startingpoint.x = e.x;             startingpoint.y = e.y;             picturebox1.invalidate();         }     } }  private void picturebox1_mouseup(object sender, mouseeventargs e) {     if (e.button == mousebuttons.right)     {         isdragging = false;     } }  private void picturebox1_mousedown(object sender, mouseeventargs e) {     if (e.button == mousebuttons.right)     {         isdragging = true;         startingpoint.x = e.x;         startingpoint.y = e.y;     } } 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -