zoukankan      html  css  js  c++  java
  • C#绘制圆角矩形

     #region 绘制圆角矩形区域

            internal static GraphicsPath CreateRoundedRectanglePath(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;
            }

            #endregion

  • 相关阅读:
    Redis分布式锁的正确实现方式(Java版)转载
    kali 安装 Burpsuite Pro v2020.8 破解
    DVWA On KALI
    Metasploit 体系结构
    Xmodem、Ymodem、Zmodem
    Metasploit psnuffle
    Metasploit通过ssh暴力破解
    使用ms17_010渗透win7
    Metasploit快速入门(二)
    Metasploit 快速入门(一)
  • 原文地址:https://www.cnblogs.com/zhangpengshou/p/1699840.html
Copyright © 2011-2022 走看看