0

I wanted to update the existing bitmap drawn >@particular coords> on SK Canvas, while calling InvalidateSurface am able to draw but the previous bitmap is not clearing. New Image is beneath the older one! Canvas.Clear(0) didn't clear all previous bitmaps.

Needed help in getting over this issue.

void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
{
    canvas.Clear(0) // Dont seems be clearing old Bitmaps
    if (condition)
    {
        using (Stream streami = assembly.GetManifestResourceStream(resourceID))
        {

            resourceBitmap = SKBitmap.Decode(streami);
        }

        canvas.DrawBitmap(resourceBitmap, listPoint);
    }
    else
    {
        using (Stream streami = assembly.GetManifestResourceStream(secondID))
        {

            secondBitmap = SKBitmap.Decode(streami);
        }
        canvas.DrawBitmap(secondBitmap, listPoint); // Drawn beneath the older
    }
}

Now the if condition changed to true outside the code blocks with new value again calling canvasView.InvalidateSurface(); Doest not clear previous

Matthew
  • 4,832
  • 2
  • 29
  • 55
Tech Cruize
  • 107
  • 1
  • 2
  • 16

0 Answers0