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

Is that possible to use Composition AcrylicBrush in .NET8 WPF apps? #134

Open
SlimeNull opened this issue Jul 6, 2024 · 1 comment
Open

Comments

@SlimeNull
Copy link

SlimeNull commented Jul 6, 2024

I have made a lot of attempts, but eventually stopped at using Win2D.

.NET8 could not use Microsoft.graphics.canvas.winmd

image

@robmikh
Copy link
Member

robmikh commented Jul 7, 2024

This is doable in theory but a bit tricky in practice. You'll need to include the CsWinRT nuget package and add the CsWinRTIncludes tag to your project file, along with the namespaces you want to generate bindings for (e.g. Microsoft.Graphics.Canvas).

In practice for Win2D, this is difficult because of certain namespace dependencies that aren't supported by CsWinRT. Mainly these are the XAML bits of the API, as well as some of the text portions.

You theoretically don't need Win2D itself, you just need to implement the right interfaces and provide the underlying D2D properties for the effect definitions. I had a project in the past that implemented a subset of the effect definitions here: https://github.com/robmikh/Robmikh.Interop.Composition

Most of us are on holiday at the moment, but I'll see if I can whip up a sample using Win2D when I get back.

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

No branches or pull requests

2 participants