AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.76k stars 2.23k forks source link

Bitmap with AlphaFormat.Opaque #4611

Open adirh3 opened 4 years ago

adirh3 commented 4 years ago

When using bitmaps with AlphaFormat.Opaque with EglInitializationAllowEglInitialization = false, the result looks like this - image You can see that the transparent pixels show what's behind the Window and not the white background that should be behind it. This isn't happening when using EglInitializationAllowEglInitialization = true - image

To repro this - Create a bitmap from PNG with transparent background using AlphaFormat.Opaque, bind it to an Image in a window that has TransparencyLevelHint >= Transparent and use EglInitializationAllowEglInitialization = false. (Everything tested in 0.10 preview 4)

Thanks

kekekeks commented 4 years ago

So, Skia just ignores the AlphaFormat and treats the image as semi-transparent, right?

adirh3 commented 4 years ago

So, Skia just ignores the AlphaFormat and treats the image as semi-transparent, right?

I think Skia does as expected (I might be wrong), the differences occur when changing Avalonia to use/not use GPU. It seems like the Border with white background behind the Image is ignored when not using GPU. (and Window Transparency >= Transparent, even with 100% opacity)