当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 我的笔记本是toshiba a30的,重装系统之后,在网上下载了相关的声卡驱动,安装之后还是没有声音,请问有可能是什么地方没有设置好或者什么地方出了毛病呢?谢谢! 请大家在半天内回答,因为我明天就要去外边修了,会很贵! ......
 ·asp.net 网页间传值问题    »显示摘要«
    摘要: 在本网站看了好多这方面的东西,但都是这也的代码 <form name="form2" method="post" action="chaxun2.php"> <input type="hidden" name="start" size="10" valu......


如何把文字保存成图片

rt,就是用.net   把一个文字保存成一个图片

NO.1   作者: LaoDai_Net

string   _FontName   =   "";  
        int   _FontSize   =   6;  
        string   _ShowName   =   "要生成图片的文字";  
         
         
        Bitmap   objBitmap   =   null;    
        Graphics   g   =   null   ;    
         
        Font   stringFont   =   new   Font(_FontName,   _FontSize,   FontStyle.Bold   );  
        StringFormat   stringFormat   =   new   StringFormat();  
        stringFormat.FormatFlags   =   StringFormatFlags.NoWrap;  
   
   
        try  
        {    
          objBitmap   =   new   Bitmap(1,1);  
          g   =   Graphics.FromImage(objBitmap);  
          SizeF   stringSize   =   g.MeasureString(_ShowName,   stringFont);  
          int   nWidth   =   (int)stringSize.Width;    
          int   nHeight   =   (int)stringSize.Height;    
          g.Dispose();    
          objBitmap.Dispose();  
   
          objBitmap   =   new   Bitmap(nWidth,nHeight);    
          g   =   Graphics.FromImage(objBitmap);    
          g.FillRectangle(new   SolidBrush(Color.Yellow),   new   Rectangle(0,0,nWidth,nHeight));    
          g.TextRenderingHint   =   TextRenderingHint.AntiAlias;  
          g.DrawString(_ShowName,   stringFont,   new   SolidBrush(Color.Black),   new   PointF(0,   0),   stringFormat);        
          objBitmap.Save(Response.OutputStream,   ImageFormat.Gif);    
        }    
        catch   (Exception   ee)    
        {    
          Response.Write(ee.ToString());    
        }    
        finally    
        {    
          if   (null   !=   g)   g.Dispose();    
          if   (null   !=   objBitmap)   objBitmap.Dispose();    
          Response.End();  
        }


    摘要: 初来宝地,不懂规矩,望各位海涵. 本人编写聊天室时机缘巧合制造出一怪文件,将此文件中代码全部清空,此文件大小仍为3字节,占据空间8k,更怪的是在此文件中编写的代码运行会出现奇怪现象.现象如下: 有两个文件ma.asp , ti.asp ma.asp页面,代码如下: <script language=javascript> var http=new activexobject(&......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE