SkiaSharp without Xamarin.Forms?

VaclavJedlickaVaclavJedlicka CZMember ✭✭
edited September 14 in SkiaSharp

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

Best Answers

Answers

Sign In or Register to comment.