今天特意找了个关于图片去圆角的文章 找到http://www.cnblogs.com/lovecherry/archive/2006/05/17/402541.html 提供了主要的关键代码: 我稍微的去了些功能 只留下了一个方法 来处理 图片圆角的功能 嘿嘿 其实其他的几个方法还没来得及看 创建一个类 COPY进去
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging;
我使用了一个笨方法来实现 一个图片一次性的将四个圆角全部切出来 这个方法太笨了
protected void Page_Load( object sender, EventArgs e) }
我试过这么做
// case "TopAll": // { // rectPath.AddArc(rect.Left, rect.Top, radius * 2, radius * 2, 180, 90); // rectPath.AddLine(rect.Left, rect.Top, rect.Left, rect.Top + radius); // rectPath.AddArc(rect.Right - radius * 2, rect.Top, radius * 2, radius * 2, 270, 90); // rectPath.AddLine(rect.Right, rect.Top, rect.Right - radius, rect.Top); // // rectPath.AddArc(rect.Left, rect.Bottom - radius * 2, radius * 2, radius * 2, 90, 90); // // rectPath.AddLine(rect.Left, rect.Bottom - radius, rect.Left, rect.Bottom); // // rectPath.AddArc(rect.Right - radius * 2, rect.Bottom - radius * 2, radius * 2, radius * 2, 0, 90); // // rectPath.AddLine(rect.Right - radius, rect.Bottom, rect.Right, rect.Bottom); // break; // } // case "BottomAll": // { // // rectPath.AddArc(rect.Left, rect.Top, radius * 2, radius * 2, 180, 90); // // rectPath.AddLine(rect.Left, rect.Top, rect.Left, rect.Top + radius); // // rectPath.AddArc(rect.Right - radius * 2, rect.Top, radius * 2, radius * 2, 270, 90); // // rectPath.AddLine(rect.Right, rect.Top, rect.Right - radius, rect.Top); // rectPath.AddArc(rect.Left, rect.Bottom - radius * 2, radius * 2, radius * 2, 90, 90); // rectPath.AddLine(rect.Left, rect.Bottom - radius, rect.Left, rect.Bottom); // rectPath.AddArc(rect.Right - radius * 2, rect.Bottom - radius * 2, radius * 2, radius * 2, 0, 90); // rectPath.AddLine(rect.Right - radius, rect.Bottom, rect.Right, rect.Bottom); // break; // }
但是 图片出来后 面目全非 哪位朋友可以帮我看看 有没有更好点的方法
相关文章: