public MainPage() { InitializeComponent(); var settings = new HighlightSettings() { StrokeWidth = 6, StrokeStartColor = Color.FromHex("#FF4600"), StrokeEndColor = Color.FromHex("#CC00AF"), AnimationDuration = TimeSpan.FromMilliseconds(900), AnimationEasing = Easing.CubicInOut, }; _highlightForm = new HighlightForm(settings); }
static SKPaint CreateHighlightSkPaint(SKCanvasView skCanvasView, HighlightSettings highlightSettings, HighlightPath highlightPath) { var skPaint = new SKPaint { Style = SKPaintStyle.Stroke, Color = SKColors.Red, StrokeWidth = (float)skCanvasView.FromPixels(new Point(0, highlightSettings.StrokeWidth)).Y }; float firstDashIntervalOn = highlightPath.FirstDash.Intervals[0]; skPaint.Shader = SKShader.CreateLinearGradient( start: new SKPoint(firstDashIntervalOn * 0.30f, 0), end: new SKPoint(firstDashIntervalOn, 0), colors: new SKColor[] { highlightSettings.StrokeStartColor.ToSKColor(), highlightSettings.StrokeEndColor.ToSKColor() }, colorPos: new float[] { 0, 1 }, mode: SKShaderTileMode.Clamp); return(skPaint); }
public HighlightForm(HighlightSettings highlightSettings) { _highlightSettings = highlightSettings; }