I think the PathGradientBrush is not supported by libgdiplus
At the left libgdiplus on Ubuntu 20.04 | At the right GDI+ of Windows 10
The code I used
Public Function MonoShadow() As Image
Dim flag As New Bitmap(500, 500)
Using g = Graphics.FromImage(flag)
Dim path As New GraphicsPath
path.AddArc(New Rectangle(0, 0, 100, 100), 90, 180)
path.AddLine(50, 0, 350, 0)
path.AddArc(New Rectangle(300, 0, 100, 100), -90, 180)
path.AddLine(50, 100, 350, 100)
Dim shadowpath As New GraphicsPath()
shadowpath.AddPath(path, False)
Dim Matrix = New Matrix()
Matrix.Translate(10, 10)
shadowpath.Transform(Matrix)
Using Brush As PathGradientBrush = New PathGradientBrush(shadowpath)
Brush.WrapMode = WrapMode.Clamp
Dim ColorBlend = New ColorBlend(3)
ColorBlend.Colors = New Drawing.Color() {Drawing.Color.Transparent, Drawing.Color.FromArgb(96, 0, 0, 0), Drawing.Color.FromArgb(96, 0, 0, 0)}
ColorBlend.Positions = New Single() {0F, 0.1F, 1.0F}
Brush.InterpolationColors = ColorBlend
g.FillPath(Brush, shadowpath)
End Using
End Using
Return flag
End Function
I think the
PathGradientBrush
is not supported by libgdiplusAt the left libgdiplus on Ubuntu 20.04 | At the right GDI+ of Windows 10![Screenshot 2021-10-11 002712](https://user-images.githubusercontent.com/77517308/136714944-49e1e61b-7010-4dbf-9235-c84136528ed0.png)
The code I used