コード例 #1
0
        public override void TouchesBegan(NSSet touches, UIEvent evt)
        {
            IndexCount++;

            var path = new UIBezierPath
            {
                LineWidth = PenWidth
            };

            var touch = (UITouch)touches.AnyObject;

            PreviousPoint = touch.PreviousLocationInView(this);

            var newPoint = touch.LocationInView(this);

            path.MoveTo(newPoint);

            InvokeOnMainThread(SetNeedsDisplay);

            CurrentPath = path;

            var line = new VESLine
            {
                Path  = CurrentPath,
                Color = CurrentLineColor,
                Index = IndexCount
            };

            Lines.Add(line);
        }
コード例 #2
0
ファイル: DrawView.cs プロジェクト: pabalexa/Moments
		public override void TouchesBegan (NSSet touches, UIEvent evt)
		{
			IndexCount++;

			var path = new UIBezierPath
			{
				LineWidth = PenWidth
			};

			var touch = (UITouch)touches.AnyObject;
			PreviousPoint = touch.PreviousLocationInView (this);

			var newPoint = touch.LocationInView (this);
			path.MoveTo (newPoint);

			InvokeOnMainThread (SetNeedsDisplay);

			CurrentPath = path;

			var line = new VESLine
			{
				Path = CurrentPath, 
				Color = CurrentLineColor,
				Index = IndexCount 
			};

			Lines.Add (line);
		}