四个角弧度不一样 不一样的四条边 不一样的四个角的弧度

番茄系统家园 · 2021-07-19 08:14:47

四个角弧度不一样 不一样的四条边 不一样的四个角的弧度

我从网上找的设置,圆角窗体的代码,最后的结果的确圆角了,但四个圆角的弧度不一样呀,什么原因呀?我眼睛的问题?还是?

//设置圆角

(,)

{

=;

=(,(diameter,diameter));

GraphicsPathpath=newGraphicsPath();

//左上角

path.AddArc(arcRect,180,90);

//右上角

arcRect.X=rect.Right-diameter;

path.AddArc(arcRect,270,90);

//右下角

arcRect.Y=rect.Bottom-diameter;

path.AddArc(arcRect,0,90);

//左下角

arcRect.X=rect.Left;

path.AddArc(arcRect,90,90);

path.CloseFigure();

returnpath;

}

publicvoidSetWindowRegion()

{

System.Drawing.Drawing2D.GraphicsPathFormPath;

FormPath=newSystem.Drawing.Drawing2D.GraphicsPath();

Rectanglerect=newRectangle(0,0,this.Width,this.Height);//this.Left-10,this.Top-10,this.Width-10,this.Height-10);

FormPath=GetRoundedRectPath(rect,10);

this.Region=newRegion(FormPath);

}

//结束

相关阅读

  • win11对话框改进 运用全新圆角窗口
  • 为什么圆角窗口设计逐渐被微软抛弃?
  • 四个角弧度不一样 不一样的四条边 不一样的四个角的弧度
  • 免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/post/15357.html。
    猜你喜欢
    最新应用
    热门应用