dotnet / dotnet/wpf

WPF Geometry.Combine throws COMException MILERR_SCANNER_FAILED when given geometry generated by GetWidenedPathGeometry()

Open
#8,255 0 comments 0 reactions 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/WPF-GeometryCombine-throws-COMException/10046248)._

---
The test application provided by the attached Visual Studio project illustrates the issue.

[MILERR_SCANNER_FAILED_MinimalReproduction.zip](https://aka.ms/dc/file?name=B2c1ea398deea491fafc4cb8885f7b992637884762012909923_MILERR_SCANNER_FAILED_MinimalReproduction.zip&tid=2c1ea398deea491fafc4cb8885f7b992637884762012909923)

The test application creates a valid Geometry object and a widened version of that Geometry using Geometry.GetWidenedPathGeometry() with a certain Pen thickness. Both geometries are then passed to Geometry.Combine(widenedGeometry, Geometry, GeometryCombinedMode.Exclude, Transform.Identity). The Geometry.Combine call throws the following exception:

Geometry.Combine failed: System.Runtime.InteropServices.COMException (0x88980004): MILERR_SCANNER_FAILED (Exception from HRESULT: 0x88980004)
at System.Windows.Media.PathGeometry.InternalCombine(Geometry geometry1, Geometry geometry2, GeometryCombineMode mode, Transform transform, Double tolerance, ToleranceType type)
at System.Windows.Media.Geometry.Combine(Geometry geometry1, Geometry geometry2, GeometryCombineMode mode, Transform transform)
at MinimalReproduction.MainWindow..ctor() in C:\Users\XXXXXX\source\repos\MILERR_SCANNER_FAILED_MinimalReproduction\MainWindow.xaml.cs:line 22

![image.png](https://aka.ms/dc/image?name=Bd36db225d6dc49b3989c816743462a92637884761272737287_20220518-150846-image.png&tid=d36db225d6dc49b3989c816743462a92637884761272737287)

---
### Original Comments

#### Feedback Bot on 5/19/2022, 11:49 AM:

(private comment, text removed)
#### Robin Boerdijk on 6/2/2022, 06:52 PM:

(private comment, text removed)
#### Feedback Bot on 9/1/2022, 07:09 AM:

(private comment, text removed)

---
### Original Solutions
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.