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
Post a Comment