Now, this is a very basic problem that has been bugged me in many projects and I haven't found an answer. How to draw a rubberband line to a picturebox or panel that follows the mouse in real-time, when it has a background image inserted to it? In VB6 there was the simple Line-method that did that perfectly. In VB.net the closest thing I've got is the DrawLine method in picturebox paint event (e.Graphics.DrawLine), and invalidating the picturebox in mousemove event clears the graphics. But when I have a large enough picturebox the line always stays a bit behind the actual mouse position (especially when moving the cursor fast).
I've tried basically every trick I know for drawing graphic to windows forms, nothing has worked. I can't use the e.Graphics.Clear method because it would replace the background image with a solid color.
Why can't I achieve this with my over 2.0Ghz PC when it was achieved years ago with a lot less effective computers?
I've tried basically every trick I know for drawing graphic to windows forms, nothing has worked. I can't use the e.Graphics.Clear method because it would replace the background image with a solid color.
Why can't I achieve this with my over 2.0Ghz PC when it was achieved years ago with a lot less effective computers?
Last edited: