扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:马金虎 来源:yesky 2007年10月25日
关键字:
<%@ Page Language = "C#" ContentType = "image/jpeg" %> <%@ Import Namespace = "System" %> <%@ Import Namespace = "System.Drawing" %> <%@ Import Namespace = "System.Drawing.Drawing2D" %> <%@ Import Namespace = "System.Drawing.Imaging" %> <html > <head > <script language = "C#" runat = "server" > void Page_Load ( object sender , EventArgs e ) { //创建一个"Bitmap"对象 Bitmap image = new Bitmap ( 400 , 400 ) ; Graphics g = Graphics . FromImage ( image ) ; g . FillRectangle ( new SolidBrush ( Color . LightGreen ) , 0 , 0 , 400 , 400 ) ; //以"Jpeg"格式保存此图片对象,在客户端显示出来 image . Save ( Response . OutputStream , ImageFormat . Jpeg ) ; } </script > </head > <body > </body > </html > |
![]() 图02:给产生的图片上色 |
<%@ Page Language = "C#" ContentType = "image/jpeg" %> <%@ Import Namespace = "System" %> <%@ Import Namespace = "System.Drawing" %> <%@ Import Namespace = "System.Drawing.Drawing2D" %> <%@ Import Namespace = "System.Drawing.Imaging" %> <html > <head > <script language = "C#" runat = "server" > void Page_Load ( object sender , EventArgs e ) { //创建一个"Bitmap"对象 Bitmap image = new Bitmap ( 400 , 400 ) ; Graphics g = Graphics . FromImage ( image ) ; g . FillRectangle ( new SolidBrush ( Color . LightGreen ) , 0 , 0 , 400 , 400 ) ; //以"Jpeg"格式保存此图片对象,在客户端显示出来 image . Save ( Response . OutputStream , ImageFormat . Jpeg ) ; } </script > </head > <body > </body > </html > |
![]() 图03:定制图片的形状 |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。