Add a website to the Uploaded Picture to add a website copyright

zhaozj2021-02-12  192

Use the .NET's System.drawing.graphics class to add a specified text or graphic to the image.

Here is an example of a function:

public void DrawText (string sImagePath, string sSavePath) {Bitmap btmDrawImage = new System.Drawing.Bitmap (sImagePath); Graphics graDrawImage = System.Drawing.Graphics.FromImage (btmDrawImage); graDrawImage.DrawString ( "www.9cbs.net", New Font ("Song", 12), New System.drawing.Solidbrush (System.drawing.Color.White), New Point (5,5)); btmdrawImage.save (ssavepath); gradrawimage.dispose (); btmdrawImage. Dispose ();

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

New Post(0)