progmgp
on September 9th 2009
I have a class that holds a bitmap. At any given time I set a form's background image to the class bitmap. I'm watching for mouse_up events and checking mouse positions. If the user chooses a particular region in the form, I want to draw a rectangle around a specified area. If the user moves the mouse with the region selected, I want to redraw just the rectangle so as to represent where the image is to be redrawn. When the user releases the mouse after a move, I redraw the class image and reset the forms background image to the class bitmap. My problem is when I'm drawing the rectangle during a move, the rectangle barely gets drawn then disappears. I have the form's double_buffer set on. If I turn double_buffer off, the rectangles show up better but the background flickers badly. How would every one suggest I handle the drawing so as to smoothly display my selection rectagles during a mouse move? The selection rectangles are drawn in the forms paint event. The Background is changed in a called method. I'm using c# 2008. Thanks for your thoughts!!
You cannot reply to this topic.