标题:遇到一个LinearGradientBrush的问题,不包含采用“5”参数的构造函数!!
只看楼主
lpkcisco
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-9-29
结帖率:0
 问题点数:0 回复次数:2 
遇到一个LinearGradientBrush的问题,不包含采用“5”参数的构造函数!!
代码是
  Font font = new Font("Arial", 20, (FontStyle.Bold));
           Rectangle rt = new Rectangle(0, 0, image.Width, image.Height);
           System.Windows.Media.LinearGradientBrush brush = new System.Windows.Media.LinearGradientBrush(rt, Color.Blue, Color.DarkRed, 3, true);
           g.DrawString(strValidCode, font, brush, 5, 2);
           g.DrawRectangle(new Pen(Color.Silver), 0, 0, image.Width - 1, image.Height - 1);
            ms = new ();
           image.Save(ms, ImageFormat.Gif);
           context.Response.ClearContent();
           context.Response.ContentType = "image/gif";
           context.Response.BinaryWrite(ms.ToArray);
报错误    1    “System.Windows.Media.LinearGradientBrush”不包含采用“5”参数的构造函数     

谢谢了!急等!!代码是
  Font font = new Font("Arial", 20, (FontStyle.Bold));
           Rectangle rt = new Rectangle(0, 0, image.Width, image.Height);
           System.Windows.Media.LinearGradientBrush brush = new System.Windows.Media.LinearGradientBrush(rt, Color.Blue, Color.DarkRed, 3, true);
           g.DrawString(strValidCode, font, brush, 5, 2);
           g.DrawRectangle(new Pen(Color.Silver), 0, 0, image.Width - 1, image.Height - 1);
            ms = new ();
           image.Save(ms, ImageFormat.Gif);
           context.Response.ClearContent();
           context.Response.ContentType = "image/gif";
           context.Response.BinaryWrite(ms.ToArray);
报错误    1    “System.Windows.Media.LinearGradientBrush”不包含采用“5”参数的构造函数     

谢谢了!急等!!
2011-10-23 17:14
txg2958
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-4-8
得分:0 
不明白啊,这个类是做什么的啊
2011-10-23 18:59
yhlvht
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:36
帖 子:707
专家分:4405
注 册:2011-9-30
得分:0 
引用名是不是弄错了啊
System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rt, Color.Blue, Color.DarkRed, 3, true);
2011-10-24 11:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-353230-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020315 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved