Exemple #1
0
        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
            };

            var firstDashIntervalOn = highlightPath.FirstDash.Intervals[0];

            skPaint.Shader = SKShader.CreateLinearGradient(
                new SKPoint(firstDashIntervalOn * 0.30f, 0),
                new SKPoint(firstDashIntervalOn, 0),
                new SKColor[]
            {
                highlightSettings.StrokeStartColor.ToSKColor(),
                highlightSettings.StrokeEndColor.ToSKColor()
            },
                new float[] { 0, 1 },
                SKShaderTileMode.Clamp
                );

            return(skPaint);
        }
Exemple #2
0
        public LoginPage()
        {
            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);
        }
Exemple #3
0
 public HighlightForm(HighlightSettings highlightSettings)
 {
     _highlightSettings = highlightSettings;
 }