【VS2010 C# 代码】把文字做成图片
Microsoft Visual Studio 2010做的C#把文字做成图片实例,主要代码: Bitmap bitmapOut = new Bitmap(600, 600); Graphics graOut = Graphics.FromImage(bitmapOut); //创建画笔 graOut.FillRectangle(Brushes.White, new Rectangle(0, 0, 600, 600)); //把b1涂成白色 Font fontText = new Font("宋体", 8); SolidBrush sbhText = new SolidBrush(Color.Black); graOut.DrawString(sText, fontText, sbhText, new PointF(10, 10)); bitmapOut.Save("D:\\temp\\temp0907.bmp"); graOut.Dispose(); bitmapOut.Dispose();
用户评论