This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
[WinForms.GDI] improve support for gradient fills #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the WinForms GDI control's support for fills using gradient paints. It's not perfect (GDI support for gradient fills remains limited), but it's an improvement that may be worth considering. Related #44
EDIT: When filing rectangles with horizontal or vertical linear gradients (perhaps the most common use case, and fully supported by GDI) the appearance is excellent. It would be great if there were some way to at least support this functionality even if the partial functionality for the rest of the fill types is omitted.
I'm a bit new here and not sure if your group is looking for these types of contributions at this time (#88) so feel free to do what you want with this, and I welcome any feedback you may have 馃憤
Demonstration
The rectangular gradient fills work great!
TestPattern1
Advanced fill gradients reveal GDIs limitations
EDIT: using
WrapMode.TileFlipXY
for linear gradients still isn't perfect, but may be less astonishing than the default tiling behavior seen in the screenshots above: