dotnet / dotnet/wpf

Implement planned/partially-coded WpfGfx features to bring more parity with GDI+ drawing

Open
#3,334 2 comments 4 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Going through the WpfGfx source, there are number of drawing features that were planned or even partially implemented that it would be great to see finally make it into .NET 5/6 WPF. The two in particular I'm looking at are:

**Compound lines** - strokes that are double/triple-pronged, like rakes. This is set up in GDI+ as a `pen.CompoundArray`. There are hooks in WpfGfx for this across a number of files (_strokefigure.cpp_, _cpen.cpp_) as `#ifdef COMPOUND_PEN_IMPLEMENTED`. In the description for the `CSimplePen` (the widening pen) in _strokefigure.h_, in the notes it says "_The alternative is a (speced, but not implemented) complex pen, which would allow multiple "prongs" on the pen (like a rake)._" Compound lines are one of the reasons I still use `System.Drawing` (and then I have to widen the stroke, convert `PathPoints` to `PathGeometry`, but given that everything else is WPF, It would be great to have this natively in WPF.

- Could Compound lines be considered for implementation in .NET 5/6 WPF?
- If not, could the "specs" - as referred to in `CSimplePen` - be provided so I could look at implementing it myself as some kind of `CComplexPen`?
----------
**Arrowheads** - aka `CustomLineCap`, aka `AdjustableArrowCap`, aka Markers, and finally in WpfGfx - aka "Line Shapes". In _lineshape.h,_ below the description of `CLineShape`, it states "_Since thefeture [sic] is not exposed and has no test coverage for them, line shapes are currently mothballed in milcore.dll. But they are exposed in milcoretest.dll._" `CustomLineCap`s are another one of the reasons I continue to use `System.Drawing` - like above, add an arrowhead, widen the stroke, and then convert `PathPoints` to `PathGeometry`.

- In looking at the code, it appears that `CLineShape` is more like `AdjustableArrowCap` (with it's predefined arrows) than it is like `CustomLineCap`, which allows for a custom paths. What I'm looking for is both `CustomLineCap` and `AdjustableArrowCap`.
- Could LineShapes be considered for implementation in .NET 5/6 WPF?

These are just two of the GDI+ features that would be great to have (finally) in WPF.

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.