我正在使用 ImageSharp 库(在 NuGet 上以 1.0.0-beta0001 的形式提供)在 .NET Core 2.0 中进行图像生成和操作,并且遇到了一些我似乎无法解决的问题。
以这个例子为基础,我试图圆化一个白色图像的角落。我发现IPath
被打孔的透明角最终会变成黑色的抗锯齿,就好像透明的“颜色”是黑色或灰色(而它根本不应该被视为任何颜色)。
这是图像的右上象限,以说明我的意思:
我尝试了PixelBlenderMode
这部分代码的所有选项,但没有一个产生我所追求的:
img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true)
{
BlenderMode = PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background
}));