Пример #1
0
        public static void BlurMaskFilter(SKCanvas canvas, int width, int height)
        {
            canvas.DrawColor(SKColors.White);

            using (var paint = new SKPaint())
                using (var filter = SKMaskFilter.CreateBlur(SKBlurStyle.Normal, 5.0f))
                {
                    paint.IsAntialias = true;
                    paint.TextSize    = 120;
                    paint.TextAlign   = SKTextAlign.Center;
                    paint.MaskFilter  = filter;

                    canvas.DrawText("Skia", width / 2f, height / 2f, paint);
                }
        }
Пример #2
0
        public static void EmbossMaskFilter(SKCanvas canvas, int width, int height)
        {
            canvas.DrawColor(SKColors.White);

            SKPoint3 direction = new SKPoint3(1.0f, 1.0f, 1.0f);

            using (var paint = new SKPaint())
                using (var filter = SKMaskFilter.CreateEmboss(2.0f, direction, 0.3f, 0.1f))
                {
                    paint.IsAntialias = true;
                    paint.TextSize    = 120;
                    paint.TextAlign   = SKTextAlign.Center;
                    paint.MaskFilter  = filter;

                    canvas.DrawText("Skia", width / 2f, height / 2f, paint);
                }
        }