Simple text watermark with ASP.NETT

xiaoxiao2021-03-06  14

Using system.io;

string FilePath = Server.MapPath ( "FengEr.jpg"); System.Drawing.Image image = System.Drawing.Image.FromFile (FilePath); System.Drawing.Graphics g = Graphics.FromImage (image); g.DrawImage ( Image, 0, 0, image.width, image.Height); font f = new font ("Huawenbo", 30); brush b = new solidbrush (color.green);

String s = request.queryString ["str"]; g.drawstring (S, F, B, 20, 290); Image.Save (Response.OutputStream, System.drawing.Image.ImageFormat.jpeg); g.dispose Image.dispose ();

In this way, it can be displayed normally.

转载请注明原文地址:https://www.9cbs.com/read-46218.html

New Post(0)