From 77f7770016eb490e0471cf3e9f23ccfa067c6354 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Date: Thu, 26 Feb 2026 23:32:12 +0530 Subject: [PATCH] Fix SplashScreen fade-out transparency regression after CsWin32 refactor Initialize _blendFunction instead of using a local BLENDFUNCTION instance. During fade-out, the uninitialized field caused AlphaFormat to be 0, resulting in transparent regions rendering gray. Fixes #11321 --- .../src/WindowsBase/System/Windows/SplashScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs index 8d8ade2183c..142ddf8fb49 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs @@ -173,7 +173,7 @@ private unsafe HWND CreateWindow(HBITMAP hBitmap, int width, int height, bool to using CreateDcScope memoryContext = new(screenContext); using SelectObjectScope selectObjectScope = new(memoryContext, hBitmap); - BLENDFUNCTION blendFunction = new() + _blendFunction = new() { BlendOp = (byte)PInvoke.AC_SRC_OVER, SourceConstantAlpha = 255, @@ -188,7 +188,7 @@ private unsafe HWND CreateWindow(HBITMAP hBitmap, int width, int height, bool to memoryContext, new(0, 0), default, - blendFunction, + _blendFunction, UPDATE_LAYERED_WINDOW_FLAGS.ULW_ALPHA)) { ((HRESULT)Marshal.GetHRForLastWin32Error()).ThrowOnFailure();