Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkiaSharp.Views.Forms.WPF nuget Package does not work out of the Box #1011

Closed
inforithmics opened this issue Nov 15, 2019 · 9 comments · Fixed by #1012
Closed

SkiaSharp.Views.Forms.WPF nuget Package does not work out of the Box #1011

inforithmics opened this issue Nov 15, 2019 · 9 comments · Fixed by #1012

Comments

@inforithmics
Copy link

inforithmics commented Nov 15, 2019

Description

https://www.nuget.org/packages/SkiaSharp.Views.Forms.WPF/1.68.1-rc.169 does not work out of the box. The Xamarin WPF Application crashes with an SKCanvasViewRenderer does not implement IRegistrable

Code
<PackageReference Include="SkiaSharp.Views.Forms.WPF" Version="1.68.1-rc.169" />

Expected Behavior

Xamarin WPF Application works without issues.

Actual Behavior

Xamarin WPF Application with Skiasharp crashes.

Basic Information

  • Version with issue: 1.68.1-rc.169
  • Last known good version: Not applicable
  • IDE: Visual Studio 2019 16.3.9
  • Platform Target Frameworks: 4.7.1
    • Windows Classic: Windows 10 1909
  • Target Devices: Desktop WPF Application

Screenshots
None

Reproduction Link
None

Workaround
Adding this Package Reference fixed it for me.

<PackageReference Include="SkiaSharp.Views.Forms">
      <Version>1.68.1-rc.169</Version>
      <ExcludeAssets>all</ExcludeAssets>
    </PackageReference>

Because during compilation it took the dll from SkiaSharp.Views.Forms
instead of SkiaSharp.Views.Forms.WPF.
I think the error is that SkiaSharp.Views.Forms.WPF has a dependency on SkiaSharp.Views.Forms. (which it shouldn't have because both
SkiaSharp.Views.Forms.WPF
and
SkiaSharp.Views.Forms provide SkiaSharp.Views.Forms.dll).
And nuget decides in my case to use the SkiaSharp.Views.Forms nuget package dll which does not work on WPF.

@mattleibow
Copy link
Contributor

mattleibow commented Nov 15, 2019

Ah, I think you may actually be wanting to use SkiaSharp.Views.WPF. Note the lack of the .Forms in the name. This just includes the WPF bits and should work with both .NET Framework and .NET Core.

Unless you are using Xamarin.Forms and then I have a dodgy package.

@mattleibow
Copy link
Contributor

I see what you mean. I created a new project and I see what you are talking about. Let me find a fix

@inforithmics
Copy link
Author

Yes you are right, I meant a Xamarin.Forms WPF Application.

@mattleibow
Copy link
Contributor

Thanks for reporting this issue. I got it fixed and it will be in the next preview release.

@mattleibow
Copy link
Contributor

I am pushing a NuGet now. rc.170 should be up soon and you can test.

@inforithmics
Copy link
Author

inforithmics commented Nov 16, 2019

I tested it and the SkiaSharp.Views.Forms.Wpf works like a charm, thanks a lot. I tested if the UWP and the Android Version work too and they seemed fine.
In the Android Version I found a strange behavior. On a real arm64 device it works, but in the emulator (x64 on a pc) the colors seem to be wrong in skiasharp.

For me it seems that in the x64 android compilation something went wrong.
For example Blue became somewhat green. and when I changed the transperency to white the colors changed to violett.

I reverted back to 1.68 and the colors looked perfect in the emulator.

@mattleibow
Copy link
Contributor

@inforithmics Could you open a new issue on this? I want to make sure that I fix any issues before we release. I don't think I changed anything for Android, but I can check. Also could you attach some screenshots/sample code that generates this?

@inforithmics
Copy link
Author

I created a new issue: #1017

@mattleibow
Copy link
Contributor

Thanks! I will investigate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants