zoukankan      html  css  js  c++  java
  • 在图片特定位置显示特定字符方法

            protected Bitmap SetImageNumber(Bitmap targetImage, string targetString)
            {
                Bitmap bmpImage 
    = targetImage;
                RectangleF rectTitle 
    = new RectangleF(11605656);
                Font displayFont 
    = new Font("Tahoma"9, FontStyle.Regular);
                SolidBrush brush 
    = new SolidBrush(Color.White);
                StringFormat strFormat 
    = new StringFormat();
                strFormat.Alignment 
    = StringAlignment.Center;
                strFormat.LineAlignment 
    = StringAlignment.Center;

                
    if (null == targetImage)
                {
                    
    return null;
                }
                
    using(Graphics g = Graphics.FromImage(bmpImage))
                {
                    g.DrawString(targetString, displayFont, brush, rectTitle, strFormat);
                }

                brush.Dispose();

                
    return bmpImage;
            }
  • 相关阅读:
    Hibernate 5.x 生成 SessionFactory 源码跟踪分析
    编译iftop
    Too many open files
    ffmpeg指定网卡
    abrt-hook-ccpp使用CPU太多
    ffplay播放时显示信息的意义
    Windows换行符和Linux换行符的替换
    directshow在WIN10下的一个BUG
    使用mirrordriver截屏
    mac xmind 激活
  • 原文地址:https://www.cnblogs.com/xh831213/p/1772072.html
Copyright © 2011-2022 走看看