Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

SkiaSharp without Xamarin.Forms?

$
0
0

Does SkiaSharp work without Xamarin.Forms? All samples I have seen were with Xamarin Forms.
I created a new Android Blank app, added this code to the OnCreate method and nothing appears on the screen.

        using (var surface = SKSurface.Create(640, 480, SKImageInfo.PlatformColorType, SKAlphaType.Premul))
        {
            SKCanvas canvas = surface.Canvas;

            // clear the canvas / fill with white
            canvas.DrawColor(SKColors.White);

            // set up drawing tools
            using (var paint = new SKPaint())
            {
                paint.TextSize = 64.0f;
                paint.IsAntialias = true;
                paint.Color = new SKColor(0x42, 0x81, 0xA4);
                paint.IsStroke = false;

                // draw the text
                canvas.DrawText("Skia", 0.0f, 64.0f, paint);
            }
        }

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>