public Bitmap BmpOut() { try { //string path = @"C:\Users\Administrator\Desktop\background.png"; Font font = new Font("微软雅黑", 11, FontStyle.Regular); Bitmap bmp = new Bitmap(Properties.Resources.Background); Graphics g = Graphics.FromImage(bmp); SolidBrush abursh = new SolidBrush(Color.Black); // for (int i = 0; i < message.Length; i++) //第一行 g.DrawString(a_id.Text, font, abursh, 300f, 96f); g.DrawString(a_name.Text, font, abursh, 515f, 96f); //第二行 g.DrawString(a_gstype.Text, font, abursh, 90f, 118f); g.DrawString(a_date.Text, font, abursh, 300f, 118f); g.DrawString(a_partment.Text, font, abursh, 515f, 118f); //第三行 g.DrawString(a_bryd.Text, font, abursh, 90f, 162f); g.DrawString(a_brsd.Text, font, abursh, 300f, 162f); g.DrawString(a_qj.Text, font, abursh, 515f, 162f); return bmp; // 保存图片 // bmp.Save(@"C:\Users\Administrator\Desktop\1.jpg"); }
笔记:C# 图片内嵌文字
Kamakoto·2019-09-19·1.46k 次阅读
Comments | NOTHING