コード例 #1
0
        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);
        }
コード例 #2
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
            };

            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);
        }
コード例 #3
0
 public HighlightForm(HighlightSettings highlightSettings)
 {
     _highlightSettings = highlightSettings;
 }