dotnet/Microsoft.Maui.Graphics

ArgumentException "Value does not fall within the expected range" when trying to load image on windows

Anav0 opened this issue · 0 comments

Anav0 commented

net7.0-windows10.0.19041.0

  var bytes = File.ReadAllBytes(IMG_PATH);
  using (MemoryStream stream = new(bytes))
  {
      var service = new Microsoft.Maui.Graphics.Win2D.W2DImageLoadingService();
      boardImage = service.FromStream(stream, ImageFormat.Png);
  }

I suspect an issue with image loader. I've tried to load different images with exact same result.

Microsoft.Maui.Graphics.Skia.SkiaImageLoadingService loads an image but then GraphicsView is not displaying it for some reason after calling canvas.DrawImage(boardImage, 10, 10, boardImage.Width, boardImage.Height);

Code: https://github.com/Anav0/Counters.Core