http://www.ourfly.com/forum/View.aspx?fbId=7&Id=313
解决方案 »
- 数据库相邻记录除法问题
- 无法加载 DLL“Syn_IDCardRead.dll”: 找不到指定的模块。
- .net生成柱状图
- ASP.NET使用ueditor不会配置路径
- 大侠们帮帮我,有个关于google地图的问题
- 谁知道sin π/4(sin4分之π)是如何计算为 根号2/2(2分之根号2)?
- vs2003升级到vs2005在本地测试MD5没问题,上传之后,以前的注册不可用了?为什么?帮帮忙?
- (过客)正则表达式 或者C#语言判断字符是否同时存在
- 急:关于局域网内建网站的问题
- 求助:关于 DataGrid 分页产生一个异常 T_T
- 用asp.net+c#+sql server2000这样的工作岗位工资能有多少呀??
- 点击datagrid的edit或select按扭时,如何使被点选的这行变色?
我一直很关注这个问题,只是在.net中不知道如何做?
{
private Bitmap m_Image;
private string m_Text; public ValidationImage(string Text, Font font, Color ForeColor, Color BackgroundColor)
{
// Create a bitmap so we can create the Grapics object
Bitmap bm = new Bitmap(1,1);
Graphics gs = Graphics.FromImage(bm); // Resize the bitmap so the width and height of the text
bm = new Bitmap(Convert.ToInt32(gs.MeasureString(Text, font).Width),Convert.ToInt32(gs.MeasureString(Text, font).Height)); // Render the bitmap
gs = Graphics.FromImage(bm);
gs.Clear(BackgroundColor);
gs.TextRenderingHint = TextRenderingHint.AntiAlias;
gs.DrawString(Text, font, new SolidBrush(ForeColor), 0, 0);
gs.Flush(); // Set the properties
m_Image = bm;
m_Text = Text;
} // Public Properties
public Bitmap Image {
get { return m_Image; }
} public string Text {
get { return m_Text; }
}
}
File Upload with ASP.NET
http://www.codeproject.com/aspnet/FileUpload.asp
string fn = Server.MapPath(@"/1.jpg");
System.IO.FileStream fs=new System.IO.FileStream(fn,FileMode.Create,FileAccess.Write);
fs.WriteByte(bytes); //生成文件
fs.Flush;
fs.Close();Response.Redirect("/1.jpg");
o.GetThumbnailImage(宽,高,null,IntPtr.Zero);