0

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 enough.

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<Point> array = new List<Point>();  // 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.

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
Mariusz
  • 908
  • 1
  • 13
  • 28
  • Can you post some code showing how you're wiring up to the events? I've done this very thing and it worked fine. – Tristan Warner-Smith Aug 12 '09 at 20:13
  • formating here is totally screwed guys. What you get is different than what you see in the editor window. I would appreciate if someone could edit the handler do make it more clear. – Mariusz Aug 13 '09 at 07:00
  • @aristo Help yourself out next time, [have a read here](http://stackoverflow.com/editing-help) :) – Jason Plank Nov 21 '11 at 21:07

1 Answers1

0

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 S.
  • 122,712
  • 22
  • 185
  • 265
  • 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. – Mariusz Aug 12 '09 at 19:36
  • 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... – Mariusz Aug 12 '09 at 19:40