易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net 将字符串生成图片 - .NET技术 / ASP.NET

我想将字符串生成一张图片,如何写?
字符串生成图片?

引用

字符串生成图片?


说简单点就是生成验证码的方法。


Private Sub Paint(ByVal strCode As String)
  Dim strImgPath As String = Server.MapPath("myCodeImg.jpg")
  Dim strTempPath As String = strImgPath
  System.IO.File.Delete(strImgPath)

  Const intWidth As Int16 = 400
  Const intHeight As Int16 = 150

  Dim myBimap As System.Drawing.Image = New System.Drawing.Bitmap(intWidth, intHeight)

  Dim myG As System.Drawing.Graphics = System.Drawing.Graphics.fromImage(myBimap)

  Dim myFont As System.Drawing.Font = New System.Drawing.Font("幼圆", 16, FontStyle.Bold)

  Dim myRect As System.Drawing.RectangleF = New System.Drawing.RectangleF(2, 2, intWidth, intHeight)

  Dim myBrush As System.Drawing.SolidBrush = New System.Drawing.SolidBrush(Color.White)

  myG.Clear(Color.Blue)

  myG.DrawString(strCode, myFont, myBrush, myRect)

  myBimap.Save(strTempPath, System.Drawing.Imaging.ImageFormat.Jpeg)
  Image1.ImageUrl = strTempPath
  myG.Dispose()
  myBimap.Dispose()
  End Sub





相关问答:

在asp.net里面脚本出错 - .NET技术 / ASP.NET

function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;

var div1=document.getElementById("divPwd");

if (pwd.value=="")
{
......

ASP伪静态 - Web 开发 / ASP

asp虚拟主机实现伪静态的方法:
1、 重写url参数
Step1: 建立前台文件index.asp,修改url参数形式。由于读取数据库中的记录不是专题的重点,故直接给出:
<!--#include file="config.asp" -->
&l ......

ASP 。NET如何选择 - Web 开发 / ASP

大家好!我是一个学生,现在是学ASP的不知道怎么回事,我自己是用CMS做过网站 代码也能看懂一点 现在想买本书,想法有很多,就是想买ASP的 又看到大家说ASP以后没有NET前景好,我又想再去买本ASP.NET的 我知道有这样的想法 ......

ASP.NET相关技术 - .NET技术 / ASP.NET

各位大侠,我学习的是ASP.NET,想知道相关技术有哪些,就像JAVA EE中有struct sping jsp severlet 等,ASP.NET还有哪些些相关技术。
http://topic.csdn.net/u/20090914/21/af27de99-f0f3-4cfd-9379-13764f8ec6b1.ht ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号