asp.net文字轉(zhuǎn)成圖片_.Net教程
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!
推薦:點(diǎn)擊按鈕提交后如何使按鈕變灰不可用.aspx script language=javascript function abc() { var mybutton=document.getElementById(Submit1); mybutton.disabled=true; //變灰 __doPostBack(Submit1,); //執(zhí)行服務(wù)器端Submit1的click事件 } /script form id=Form1 method=post runat=
| using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; public class Drawing { public void CreateImage(string name,string filePath) { int wid=300; int high=200; Font font=new Font("Arial",48,FontStyle.Bold); //字的顏色 SolidBrush brush=new SolidBrush(Color.Black); Bitmap image=new Bitmap(wid,high); Graphics g=Graphics.FromImage(image); g.Clear(ColorTranslator.FromHtml("#f0f0f0")); RectangleF rect=new RectangleF(5,2,wid,high); //繪制圖片 g.DrawString(name,font,brush,rect); //保存 image.Save(filePath,ImageFormat.Jpeg); //釋放對(duì)象 g.Dispose(); image.Dispose(); } } public class Program { public static void Main() { Drawing dh=new Drawing(); Console.WriteLine("輸入文字:"); string name=Console.ReadLine(); dh.CreateImage(name,@"e:\test\c#\advanced\Name.jpg"); } } |
分享:asp.net備份還原SQLServer實(shí)例代碼程序主要是利用SQLServer提供的SQL語(yǔ)句來(lái)實(shí)現(xiàn)備份的。 備份:usemaster;backupdatabase@nametodisk=@path; 恢復(fù):usemaster;restoredatabase@namefromdisk=@path; 上面用的是參數(shù)化SQL語(yǔ)句,可以在程序執(zhí)行的時(shí)候動(dòng)態(tài)給參數(shù)賦值。 .aspx代碼: %@PageLanguage=C#
相關(guān).Net教程:
- asp.net如何得到GRIDVIEW中某行某列值的方法
- .net SMTP發(fā)送Email實(shí)例(可帶附件)
- js實(shí)現(xiàn)廣告漂浮效果的小例子
- asp.net Repeater 數(shù)據(jù)綁定的具體實(shí)現(xiàn)
- Asp.Net 無(wú)刷新文件上傳并顯示進(jìn)度條的實(shí)現(xiàn)方法及思路
- Asp.net獲取客戶(hù)端IP常見(jiàn)代碼存在的偽造IP問(wèn)題探討
- VS2010 水晶報(bào)表的使用方法
- ASP.NET中操作SQL數(shù)據(jù)庫(kù)(連接字符串的配置及獲取)
- asp.net頁(yè)面?zhèn)髦禍y(cè)試實(shí)例代碼
- DataGridView - DataGridViewCheckBoxCell的使用介紹
- asp.net中javascript的引用(直接引入和間接引入)
- 三層+存儲(chǔ)過(guò)程實(shí)現(xiàn)分頁(yè)示例代碼
- 相關(guān)鏈接:
- 教程說(shuō)明:
.Net教程-asp.net文字轉(zhuǎn)成圖片
。