SkiaSharp without Xamarin.Forms?

VaclavJedlickaVaclavJedlicka CZMember ✭✭

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

            // 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);

Best Answers


Sign In or Register to comment.