Skip to content

Commit 0c35e4c

Browse files
committed
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
1 parent 9484c1c commit 0c35e4c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private unsafe HWND CreateWindow(HBITMAP hBitmap, int width, int height, bool to
173173
using CreateDcScope memoryContext = new(screenContext);
174174
using SelectObjectScope selectObjectScope = new(memoryContext, hBitmap);
175175

176-
BLENDFUNCTION blendFunction = new()
176+
_blendFunction = new()
177177
{
178178
BlendOp = (byte)PInvoke.AC_SRC_OVER,
179179
SourceConstantAlpha = 255,
@@ -188,7 +188,7 @@ private unsafe HWND CreateWindow(HBITMAP hBitmap, int width, int height, bool to
188188
memoryContext,
189189
new(0, 0),
190190
default,
191-
blendFunction,
191+
_blendFunction,
192192
UPDATE_LAYERED_WINDOW_FLAGS.ULW_ALPHA))
193193
{
194194
((HRESULT)Marshal.GetHRForLastWin32Error()).ThrowOnFailure();

0 commit comments

Comments
 (0)