Esempio n. 1
0
		protected virtual void AddPointsToStroke(Contact contact)
		{
			Stroke stroke = (Stroke)contact.GetUserData(key);
			if (stroke == null)
				StartStroke(contact);
			else
			{
				StylusPointCollection stylusPoints = stroke.StylusPoints;
				if (stylusPoints != null)
				{
					Point position = contact.GetPosition(this);
					stylusPoints.Add(new StylusPoint(position.X, position.Y, 0.5f));
				}
			}
		}
Esempio n. 2
0
		protected virtual void EndStroke(Contact contact)
		{
			Stroke stroke = (Stroke)contact.GetUserData(key);
			if (stroke != null)
			{
				InkCanvasStrokeCollectedEventArgs args = new InkCanvasStrokeCollectedEventArgs(stroke);
				OnStrokeCollected(args);
			}
		}
Esempio n. 3
0
		private void RemovePartialStroke(Contact contact)
		{
			Stroke stroke = (Stroke) contact.GetUserData(key);
			if(stroke != null)
			{
				inkCanvas.Strokes.Remove(stroke);
				contact.SetUserData(key, null);
			}
		}