|
/* 豆腐制作 都是精品 http://www.asp888.net 豆腐技术站 如转载 请保留版权信息 */ 这个程序经过修改 现在作计数器的话 只能做黑白的 计数器,谁有办法 能够做出 复杂的 图形计数器? <% @Page Language="C#" %> <% @Import Namespace="System.Drawing" %> <% @Import Namespace="System.IO" %> <% @Import Namespace="System.Drawing.Imaging" %> <% Response.Expires = 0; Bitmap newBitmap = null; Graphics g = null ; string str2Render = Request.QueryString.Get("HitCount"); if (null == str2Render) str2Render = "12345"; string strFont = Request.QueryString.Get("HitFontName"); if (null == strFont) strFont = "楷体_GB2312"; int nFontSize = 12; try { nFontSize = Request.QueryString.Get("HitFontSize").ToInt32(); } catch { // do nothing, just ignore }
string strBackgroundColorname = Request.QueryString.Get("HitBackgroundColor"); Color clrBackground = Color.White; try { if (null != strBackgroundColorname) clrBackground = ColorTranslator.FromHTML(strBackgroundColorname); } catch { }
string strFontColorName = Request.QueryString.Get("HitFontColor"); Color clrFont = Color.Black; try { // Format in the URL: %23xxXXxx if (null != strFontColorName) clrFont = ColorTranslator.FromHTML(strFontColorName); } catch { }
try { Font fontCounter = new Font(strFont, nFontSize); newBitmap = new Bitmap(1,1,PixelFormat.Format32bppARGB); g = Graphics.FromImage(newBitmap); SizeF stringS [1] [2] 下一页
|