ASP. NET Text watermark

Source: Internet
Author: User

    /// <summary>    ///  do picture watermark (Drawing,io)      /// </summary>    /// <param name= "InPath" > Enter picture template path </param>    /// <param name= "Outpath" > Enter picture path </param>     /// <param name= "Onestr" > 1th line Text </param>    ///  <param name= "Onescript" >1-fonts </param>    /// <param  Name= "onesize" >1-font size </param>    /// <param name= "OneX" >1-x coordinates < /param>    /// <param name= "Oney" >1-y coordinates </param>     /// <param name= "Twostr" > 2nd line text </param>    /// <param  name= "Twoscript" >2-font </param>    /// <param name= "TwoSize" > 2-Font Size &LT;/PARAM&GT;&NBSP;   /// <param name= "Twox" >2-x coordinates </param>    ///  <param name= "Twoy" >2-y coordinates </param>    private void  Mygraphics (String inpath, string outpath, string onestr, string onescript,  int oneSize, int oneX, int oneY, string twoStr, string  Twoscript, int twosize, int twox, int twoy)     {         string one = oneStr;         string two = twostr;        memorystream  ms = new memorystream ();         bitmap bmp  = new bitmap (Server.MapPath (Inpath));         graphics  g = graphics.fromimagE (BMP);         g.drawstring (One, new font (oneScript,  Onesize),  brushes.white, new point (Onex, oney));         g.drawstring (Two, new font (twoscript, twosize),  brushes.white, new point ( Twox, twoy));         bmp. Save (ms, system.drawing.imaging.imageformat.jpeg);         System.drawing.image i = system.drawing.image.fromstream (MS);         i.save (Outpath);         g.dispose ();         bmp. Dispose ();     }


This article is from the "Program Ape's Home" blog, please be sure to keep this source http://962410314.blog.51cto.com/7563109/1435290

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.