SkiaSharp.Extended icon indicating copy to clipboard operation
SkiaSharp.Extended copied to clipboard

[QUESTION] .net 9 MAUI SkiaSharp.SKMatrix SkiaSharp.SKMatrix.MakeTranslation(single,single) missing

Open sisaacks opened this issue 10 months ago • 3 comments

I am not sure if this is a bug or not....

I upgraded to .net 9 MAUI. Then I updated the nugets based on this information: https://learn.microsoft.com/en-us/dotnet/maui/migration/skiasharp?view=net-maui-9.0

I am trying to open an SVG and now when I call svgLoad(stream) below I am getting the following error:

System.MissingMethodException: Method not found: SkiaSharp.SKMatrix SkiaSharp.SKMatrix.MakeTranslation(single,single) at SkiaSharp.Extended.Svg.SKSvg.LoadElements(IEnumerable`1 elements, SKCanvas canvas, SKPaint stroke, SKPaint fill) at SkiaSharp.Extended.Svg.SKSvg.Load(XDocument xdoc) at SkiaSharp.Extended.Svg.SKSvg.Load(XmlReader reader) at SkiaSharp.Extended.Svg.SKSvg.Load(Stream stream) at Myproject.Views.MyView.CanvasView_PaintSurface

I am not sure what I am doing wrong or how to fix this. I have spent hours looking on google and cannot find the correct answer. I had updated to the latest nugets but thats when the problems started. So I downgraded and I am still having issues. I am hoping someone can point me on the right direction or explain what I need to do

Below are the nugets I am using and my current code

` SKSvg? svg = new();

using (Stream? stream = GetType().Assembly.GetManifestResourceStream(resourceId)) { if (stream != null) { try { svg.Load(stream); } catch (Exception ex) {

 var message = ex;

}

ReticleLayoutUtility.DrawLayout(info, _canvas, svg, _vm); _vm.UpdateProperties(); } }`

sisaacks avatar Feb 22 '25 18:02 sisaacks

I have a very similar issue. MakeTranslation is missing.

JRPMike avatar Feb 24 '25 21:02 JRPMike

I could not get it the svg LOAD to work. After a lot of google searching I found the following which worked

Below is a link and about half way down the page you willf find info about Svk.Skia https://www.pshul.com/2018/01/25/xamarin-forms-using-svg-images-with-skiasharp/

Svk.Skia offers a more complete svg document model and rendering – solving my black SVGs. It might be helpful for others: https://github.com/wieslawsoltes/Svg.Skia/

To use:

  1. Add the Svk.Skia package via Nuget.
  2. Replace the using: using SKSvg = Svg.Skia.SKSvg;

On Mon, Feb 24, 2025 at 1:47 PM JRPMike @.***> wrote:

I have a very similar issue. MakeTranslation is missing.

— Reply to this email directly, view it on GitHub https://github.com/mono/SkiaSharp.Extended/issues/306#issuecomment-2679726209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOZ5VYGNY7JJCWP2WXCZX332ROHPHAVCNFSM6AAAAABXVHCRG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZZG4ZDMMRQHE . You are receiving this because you authored the thread.Message ID: @.***> [image: JRPMike]JRPMike left a comment (mono/SkiaSharp.Extended#306) https://github.com/mono/SkiaSharp.Extended/issues/306#issuecomment-2679726209

I have a very similar issue. MakeTranslation is missing.

— Reply to this email directly, view it on GitHub https://github.com/mono/SkiaSharp.Extended/issues/306#issuecomment-2679726209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOZ5VYGNY7JJCWP2WXCZX332ROHPHAVCNFSM6AAAAABXVHCRG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZZG4ZDMMRQHE . You are receiving this because you authored the thread.Message ID: @.***>

sisaacks avatar Feb 24 '25 22:02 sisaacks

I could not get it the svg LOAD to work. After a lot of google searching I found the following which worked

Below is a link and about half way down the page you willf find info about Svk.Skia https://www.pshul.com/2018/01/25/xamarin-forms-using-svg-images-with-skiasharp/

Svk.Skia offers a more complete svg document model and rendering – solving my black SVGs. It might be helpful for others: https://github.com/wieslawsoltes/Svg.Skia/

To use:

  1. Add the Svk.Skia package via Nuget.
  2. Replace the using: using SKSvg = Svg.Skia.SKSvg;

Thanks! Svg.Skia worked perfectly.

JRPMike avatar Feb 24 '25 22:02 JRPMike