views:

649

answers:

1

Hi Guys,

I play with small but hopefuly nice app for WM6. I have noticed that there is no MouseUp and MouseDown triggered when playing with stylus (acting as a mouse) on the screen.

That's ok for me, I mean I can live without it. But there is something else happening that I cannot live with for a change.

When paint on the screen using stylus and read coordinates of the mouse every MouseMove event I get something (lets say for X axis) like: 2,4,6,8,10,12 etc. (every second one) This same happens for Y axis.

In other words no matter how slow I move stylus I never get coordinates like 2,3,4,5,6 etc. Using this coordinates to paint I don't get nice continuous line but rather separate dots.

Hopefully I have made myself clear enought. I will appreciate any help guys.

Reagrds Mariusz

ps. I forgot about one thing. To paint on the screen I use pictureBox and bitmap attached to this pictureBox. When paint on the bitmap I cannot see the evect on the screen unless I refresh the pictureBox or do something like pictureBox.Image = bitmap;

What should I do to see painted dots straight away without refreshing whole pictureBox?

[edit]

List array = new List(); // in the header of the class

private void pictureBox_Screen_MouseMove(object sender, MouseEventArgs e) //event handler body { array.Add(new Point(e.X, e.Y)); }

As you can see, it is very simple routine. I have deleted all unnecessary noise to make it more clear.

A: 

If your only problem is that you need to draw a line by painting each pixel that you catch in mouse move, just connect the dots and you should be set. Even in a "standard" app you will never get each point in MouseMove if the user moves the mouse quickly, so the fact that you don't get every coordinate with the stylus should not be a problem.

Ed Swangren
Hi Ed, remember that I "haven't experienced" any MouseUp/Down events on WM6. In this case I don't know when stylus is taken away from the screen. Only one way that notifies me that the user is painting is MouseMove event.
aristo
Another thing is that in the writing recognition which is build in into WM6 OS you can paint slowly and see that the coordinates are perfectly accurate...
aristo