High-resolution images display abnormally in Software rendering mode
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
I have a png image with a height of more than 40,000 pixels, which is displayed in a WPF interface. When scrolling to the back part, the display is abnormal.
When I set the render mode to software, the image will be blue on the screen when scrolling down.
`RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;`
When I set the render mode to default, the program crashed with exception thrown:
```
System.Runtime.InteropServices.COMException
HResult=0x88980406
Message=UCEERR_RENDERTHREADFAILURE (异常来自 HRESULT:0x88980406)
Source=PresentationCore
StackTrace:
在 System.Windows.Media.Composition.DUCE.Channel.SyncFlush() 在 System.Windows.Media.Composition\DUCE.cs 中: 第 241 行
在 System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) 在 System.Windows.Interop\HwndTarget.cs 中: 第 1386 行
在 System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) 在 System.Windows.Interop\HwndTarget.cs 中: 第 1278 行
在 System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Interop\HwndTarget.cs 中: 第 800 行
在 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 System.Windows.Interop\HwndSource.cs 中: 第 1018 行
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
```
### Reproduction Steps
The source code is here: [JerryJian/LargeImageTest](https://github.com/JerryJian/LargeImageTest)
1. Change App.xaml.cs: RenderOptions.ProcessRenderMode = RenderMode.Software;
2. Compile the program, launch it
3. Scroll down, the screen become blue
1. Change App.xaml.cs: RenderOptions.ProcessRenderMode = RenderMode.Default;
2. Compile the program, launch it
3. Exception thrown on my computer
My system information:
Operating System: Windows Pro 11 24H2,
Version: 26100.2454,
Experience pack: 1000.26100.36.0
Graphics Card: NVIDIA GeForce GTX 1650
Driver version: 32.0.15.6094
DirectX version: 12 (FL 12.1)
### Expected behavior
The large image display well when render mode is software.
### Actual behavior
The large image displays abnormally.
### Regression?
_No response_
### Known Workarounds
_No response_
### Impact
_No response_
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.