给图片添加文字

来源:互联网 发布:虚拟化桌面软件 编辑:程序博客网 时间:2024/05/16 13:06


Bitmap bmp = new Bitmap(filename);Graphics g = Graphics.FromImage(bmp);String str = "hello, string";Font font = new Font("宋体", 8);SolidBrush sbrush = new SolidBrush(Color.Black);g.DrawString(str, font, sbrush, new PointF(10, 10));MemoryStream ms = new MemoryStream();bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);