C#生成验证码
来源:互联网 发布:淘宝卖家怎么分类宝贝 编辑:程序博客网 时间:2024/04/29 10:41
public static bool GenRad(string strRadnum,System.IO.Stream oOutStream,int nWidth,int nHeight)
{
System.Drawing.Bitmap oImage;
try
{
oImage=new System.Drawing.Bitmap(nWidth,nHeight);
}
catch(System.Exception Dr_ERr)
{
CardSale.Tools.ErrorLog.WriteLog("Photo/GenRad(string strRadnum,System.IO.Stream oOutStream,int nWidth,int nHeight)",Dr_ERr.Message);
return false;
}
System.Drawing.Graphics oGr=System.Drawing .Graphics.FromImage(oImage);
System.Drawing.SolidBrush oBack=new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(255,255,255));
oGr.FillRectangle(oBack,0,0,nWidth,nHeight);
System.Drawing.Pen oPen=new System.Drawing.Pen(System.Drawing.Color.Black);
System.Drawing.Font oFont=new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif,12);
System.Drawing.SolidBrush oLine=new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(0,0,0));
System.Drawing.Imaging.ImageAttributes imageAttr = new System.Drawing.Imaging.ImageAttributes();
imageAttr.SetGamma(0.1F);
oGr.DrawString(strRadnum,oFont,oLine,5,0);
try
{
oImage.Save(oOutStream,System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch
{
oGr.Dispose();
oImage.Dispose();
return false;
}
oGr.Dispose();
oImage.Dispose();
return true;
}
- C#生成验证码
- C#生成验证码
- c# 生成验证码
- C#验证码生成
- C#生成验证码
- C#验证码生成
- C#生成验证码
- C#生成验证码
- c# 验证码生成
- c# 验证码生成
- c#生成验证码
- C#生成验证码
- C#生成验证码
- C#生成验证码
- C#生成验证码
- C#生成验证码
- C#生成验证码
- C#验证码生成
- 每月9日-隐士—— 每月1日-魔术师
- Access数据库规范化技巧
- 保存至今最早的一副塔罗牌
- 带滚动条的table
- 用正则表达式检验IP是否合法
- C#生成验证码
- 塔罗牌目录
- 叶子的分页类
- eclipse日积月累-快捷键
- 1月13日源码中国asp总下载排行,希望能有用。
- My MPC·暴风影音 5.00_Stable
- window.open()的所有参数列表
- 解析二级指针与二维数组之间的关系
- [转载]利用SQL Server的DTS操作EXCEL、Access等数据表的导入导出