1
我用下面的代码文本添加到图像:C#的GraphicsPath添加文字与不透明
private void AddText(Graphics graphics, FontDetails fontDetails, Rectangle destination)
{
using (GraphicsPath graphicsPath = new GraphicsPath())
{
graphicsPath.AddString(
"My sample text",
fontDetails.FontFamily,
fontDetails.FontStyle,
fontDetails.FontEmHeight,
destination,
fontDetails.FontStringFormat
);
graphics.FillPath(new SolidBrush(FontColour), graphicsPath);
}
}
这是可以正常使用。我希望能够对文本应用不透明效果,但似乎无法找到这样做的选项。
任何帮助将不胜感激。
使用α,像FontColour =颜色.FromArgb(32,Color.Black);配置画笔。 –