Document.TouchScreen/TestInkVance/MaobiDynamicRenderer2.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Input.StylusPlugIns;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace TestInkVance
{
internal class MaobiDynamicRenderer2 : DynamicRenderer
{
[ThreadStatic]
private double StrokeWidth = 10.0;
[ThreadStatic]
private Point prevPoint;
protected override void OnStylusDown(RawStylusInput rawStylusInput)
{
this.prevPoint = new Point(double.NegativeInfinity, double.NegativeInfinity);
base.OnStylusDown(rawStylusInput);
}
protected override void OnDraw(DrawingContext drawingContext, StylusPointCollection stylusPoints, Geometry geometry, Brush fillBrush)
{
//base.OnDraw(drawingContext, stylusPoints, geometry, fillBrush);
//return;
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 < stylusPoints.Count; i++)
{
point2 = (Point)stylusPoints[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)))
{
后面还有 21 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
