Document.TouchScreen/TestInkVance/MaobiStroke2.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Windows;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace TestInkVance
{
	internal class MaobiStroke2 : Stroke
	{
		private double StrokeWidth = 10.0;
		private StylusPointCollection s;
		public MaobiStroke2(StylusPointCollection stylusPoints) : base(stylusPoints)
		{
			this.s = stylusPoints;
		}
        
		protected override void DrawCore(DrawingContext drawingContext, DrawingAttributes drawingAttributes)
		{

            ImageSource imageSource = new BitmapImage(new Uri("pack://application:,,,/Resources/1.png"));
            
            Point point = new Point(double.NegativeInfinity, double.NegativeInfinity);
            double num = this.StrokeWidth + 20.0;
            Point point2 = new Point(0.0, 0.0);
            Vector vector = new Vector();
            double num2 = 0.0;
            double num3 = 0.0;
            double strokeWidth = this.StrokeWidth;
            double x = 0.0;
            double y = 0.0;
            for (int i = 0; i < this.s.Count; i++)
            {
                point2 = (Point)this.s[i];
                vector = Point.Subtract(point, point2);
                if (vector.Length <= 4)
                    continue;

                num2 = (point2.Y - point.Y) / vector.Length;
                num3 = (point2.X - point.X) / vector.Length;
                if ((num - vector.Length) < this.StrokeWidth)
                {
                    strokeWidth = this.StrokeWidth;
                }
                else
                {
                    strokeWidth = num - vector.Length;
                }
                for (double j = 0.0; j < vector.Length; j++)
                {
                    x = 0.0;
                    y = 0.0;
                    if (((point.X == double.NegativeInfinity) || (point.Y == double.NegativeInfinity)) || ((double.PositiveInfinity == point.X) || (double.PositiveInfinity == point.Y)))
                    {
                        y = point2.Y;
                        x = point2.X;
                    }
                    else
                    {
                        y = point.Y + num2;
后面还有 16 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。