OnMouseMove problems
Hello,
I have an Image Box that has a grid on it which displays an icon. When a user clicks the left mouse button and drags it over the picture box it fills in the pixel with the select color.
The problem is this, when a user moves the mouse to fast it misses pixels. If the mouse is moved moderatly fast it will miss about every third, if it is fast then it will miss around 4 then draw one.
So it looks like this:
- - -- - --
Where the - are representing filled in spaces when a user drags fast in a straight line.
The method I use is dc.FillSolidRect(...). When the mouse is dragged slow, this problem doesn't occur. I think that the OnMouseMove commands are not completing (or that is the way it seems).
Any ideas on how to make this work? I've created a DoEvents class and added that which didn't help.
Here is the code:
if (m_bDragging == true) {
mDC->FillSolidRect(lastCol * space + 1, lastRow * hSpace,space - 1, hSpace - 1, ForeColor);
}
lastCol represents the previous x (I.E. 4)
lostRow is previous y (I.E. 3)
Space and hspace are the width of the block (for zooming, can be anywhere from 5-30 in size)
I've tried setting the current row and pixel to the color with the same effect.
Any help?
__________________
Lop
|