I am using GraphicsPath to add a string, then the returned PathPoints i use for the PathGradientBrush to make the figure's backcolor gradient.
However most of the Fonts with clear-cut figures are not properly closed in GraphicsPath, while others those curved are properly joined.
I tried .CloseFigure, also manually tried to add a line from .PathPoints(0) to .PathPoints(PathPoints.Length-1), with no success. Has anybody experienced this behaviour?
e.Graphics.Clear(Me.BackColor)
Using gp As New GraphicsPath
gp.FillMode = FillMode.Winding
gp.AddString(result, ft.FontFamily, ft.Style, ft.Size, stringLocation, StringFormat.GenericTypographic)
gp.CloseFigure()
Dim gpB As New PathGradientBrush(gp.PathPoints, WrapMode.Clamp)
With gpB
Dim _surroundingColor As Color = DimColor(_color, 255)
.SurroundColors = New Color(4 - 1) {}.[Select](Function(item) _surroundingColor).ToArray()
.SetSigmaBellShape(0.1!)
Dim _centerColor As Color = DimColor(_color, 200)
.CenterColor = _centerColor
End With
e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
e.Graphics.FillPath(gpB, gp)
End Using
What I have tried:
--------------------------------------------------------------