using System.Threading.Tasks;
using System.IO;
using System.Drawing;
public static int Shuy(string Sname,string fname)
{
try
{
Image image = Image.FromFile(fname);
Graphics gra = Graphics.FromImage(image);
String text = Sname;
Font font = new Font("宋体", 26);
SizeF size = new SizeF();
SolidBrush seli = new SolidBrush(Color.FromArgb(220, 220, 0, 0));
gra.DrawString(text, font, seli, new PointF(image.Width / 5, image.Height / 2 - size.Height / 2));
image.Save(@"E:高四日考k2k2hahalala11.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
return 1;
}
catch (Exception)
{
return 0;
throw;
}
}