点滴积累,融会贯通

-----喜欢一切有兴趣的东西

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
        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;
        }

 

posted on 2010-07-06 13:39  小寒  阅读(232)  评论(0编辑  收藏  举报