SkiaSharp WPF <- Important

I want to display the Compass.png image at a certain location on my SkiaSharp canvas. I am already drawing lines and circles on the canvas, I do NOT need help with that.
private void MyCanvas_PaintSurface(object sender, SKPaintSurfaceEventArgs e)
{
var surface = e.Surface;
var canvas = surface.Canvas;
canvas.Clear(SKColors.Black);
// ... working drawing code drawing lines/circles already here
// ** Need to add code here to load the compass image from the file and display it on the canvas at say (0, 0)?
}
Note: WPF.
Worked it out...
var image = SKImage.FromEncodedData(@"Images\Compass.png");
var bm = SKBitmap.FromImage(image);
canvas.DrawBitmap(bm, new SKPoint(0, 0));
Obviously, better to just set the bm one time and reuse it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With