Bitmap bmp = new Bitmap(pictureBox1.Image);//加载位图 pictureBox1.Image
Graphics g = Graphics.FromImage(bmp);
Font font = new Font("Tahoma", 25, FontStyle.Bold);//设置字体
SolidBrush sbrush = new SolidBrush(Color.White);//字体颜色
g.DrawString(globaldata.relative_height, f

本文介绍了如何使用C#的GDI+库在图片上绘制文字,并设置文字为白色,同时实现Label的透明背景。通过创建Bitmap对象、Graphics对象,设置Font和SolidBrush,然后在指定位置DrawString,最后将结果保存到pictureBox控件中展示。
3万+

被折叠的 条评论
为什么被折叠?



