基本信息
源码名称: GDI+ 绘图的辅助类(渲染背景/构建圆角/图像处理)
源码大小:7.33KB
文件格式:.cs
开发语言:C#
更新时间:2016-03-08
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 3 元 
   源码介绍

图像处理的方法封装


  #region CreateRoundPath 构建圆角路径
 
      /// <summary>       /// 构建圆角路径       /// </summary>       /// <param name="rect"></param>       /// <param name="cornerRadius"></param>       /// <returns></returns>       public static GraphicsPath CreateRoundPath(Rectangle rect, int cornerRadius)
      {
          GraphicsPath roundedRect = new GraphicsPath();
          roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
          roundedRect.AddLine(rect.X   cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
          roundedRect.AddArc(rect.X   rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
          roundedRect.AddLine(rect.Right, rect.Y   cornerRadius * 2, rect.Right, rect.Y   rect.Height - cornerRadius * 2);
          roundedRect.AddArc(rect.X   rect.Width - cornerRadius * 2, rect.Y   rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
          roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X   cornerRadius * 2, rect.Bottom);
          roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
          roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y   cornerRadius * 2);
          roundedRect.CloseFigure();
          return roundedRect;
      }