Пример #1
0
    private void DrawBumps(SKCanvas canvas, float radius)
    {
        canvas.Save();

        _paint.Style = SKPaintStyle.Fill;

        _paint.Shader = SKShader.CreateRadialGradient(new SKPoint(radius.Scale(0.01f), -radius.Scale(0.01f)),
                                                      radius.Scale(0.05f),
                                                      BackgroundColor.BumpsGradientColor(IsEnabled),
                                                      new float[] { 0f, 0.8f, 1f },
                                                      SKShaderTileMode.Clamp);



        canvas.Save();

        canvas.Translate(0, radius.Scale(0.25f));

        canvas.DrawCircle(0, 0, radius.Scale(0.05f), _paint);

        canvas.Restore();

        canvas.Save();

        canvas.Translate(0, -radius.Scale(0.25f));

        canvas.DrawCircle(0, 0, radius.Scale(0.05f), _paint);

        canvas.Restore();

        canvas.Save();

        canvas.Translate(radius.Scale(0.25f), 0);

        canvas.DrawCircle(0, 0, radius.Scale(0.05f), _paint);

        canvas.Restore();

        canvas.Save();

        canvas.Translate(-radius.Scale(0.25f), 0);

        canvas.DrawCircle(0, 0, radius.Scale(0.05f), _paint);

        canvas.Restore();

        _paint.ImageFilter = null;

        canvas.Restore();
    }