Does anyone know how to create a crescent-shaped gradient-mask in GDI+ for a windows form in VB.Net or C#, like the light-blue one in the link above, that I can add to an earth image. I have managed to create various circle gradients, also in the above link, that can help to make an image look more spherical, but I would like to generate the crescent one as well, if it is possible.
Asked
Active
Viewed 76 times
0
-
2create the mask from a path and set the centerpoint outside or at the edge of the (in this case, leftmost) more translucent part: https://learn.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-creating-a-path-gradient-use – Cee McSharpface Apr 23 '20 at 10:23
-
1You have to couple a PathGradientBrush with a ColorBlend object, as described here: [How to: Create a Path Gradient](https://docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/how-to-create-a-path-gradient). There's an almost unknown property of the PathGradientBrush, `FocusScales`, that can help to remove small artifacts and produce a smoother effect. I described it here: [A shadow created with PathGradientBrush shows undesired thorn results](https://stackoverflow.com/a/56221869/7444103). Since it's ignored almost anywhere, keep it mind. As mentioned there, always use float values. – Jimi Apr 23 '20 at 13:12