num = this.rand.Next(1, 36);
strListNum = strListNum + strListCode.Substring(num - 1, 1);
}
this.Session["checkcode"] = strListNum;
base.Response.Cookies.Add(new HttpCookie("CheckCode", SHA1(strListNum)));
this.CreateImage(strListNum);
【vb.net绘制点 vbnet showdialog】 }
private void CreateImage(string checkCode)
{
int iwidth = checkCode.Length * 8;
Bitmap image = new Bitmap(70, 30);
Graphics g = Graphics.FromImage(image);
g.SmoothingMode = SmoothingMode.HighQuality;
Font f = new Font("Arial ", 14f, FontStyle.Bold);
Brush b = new SolidBrush(Color.Black);
Rectangle rect = new Rectangle(0, 0, 80, 30);
HatchBrush hatchBrush = new HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.LightGray, Color.LightSkyBlue);
g.FillRectangle(hatchBrush, rect);
float CPostion = 1f;
for (int i = 0; icheckCode.Length; i++)
{
this.TransformG(g);
SizeF size = g.MeasureString(checkCode[i].ToString(), f);
g.DrawString(checkCode[i].ToString(), f, b, CPostion, 5f);
CPostion += size.Width - 1f;
g.ResetTransform();
}
MemoryStream ms = new MemoryStream();
image.Save(ms, ImageFormat.Jpeg);
g.Dispose();
image.Dispose();
base.Response.ClearContent();
base.Response.ContentType = "image/Jpeg";
base.Response.BinaryWrite(ms.ToArray());
}
private void TransformG(Graphics g)
{
Matrix myMatrix = new Matrix();
int num1 = this.rand.Next(80, 900);
int num2 = this.rand.Next(80, 800);
float dd1 = num1;
float dd2 = num2;
dd1 /= 10000f;
dd2 /= 10000f;
float f1 = dd1;
float f2 = dd2;
myMatrix.Shear(f1, f2);
g.MultiplyTransform(myMatrix);
}
}
}
关于vb.net绘制点和vbnet showdialog的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- 过年看电视叫什么节目,过年看的节目
- 穿越火线显卡特效怎么关,穿越火线的显卡设置
- vb.net还有发展吗 vbnet ui
- shiroredis缓存管理,shiro 缓存
- 显卡更新不了怎么办,显卡更新没反应
- 虚拟机迁移到共享存储,虚拟机迁移到共享存储卡
- c语言用函数求累和 c语言求累加和函数
- 资本论下载,资本论下载百度网盘
- 华硕飞行堡垒5游戏评测,华硕飞行堡垒5是什么型号