C# 中图片框的圆角边缘
如何在图片框控件中圆化边缘。我想要获得像椭圆一样的角度,但我不知道该怎么做。我使用 C#。谢谢!
How to round edges in picturebox control. I Want to get angles like ellipse have but i dont know how to do it. I Use C#. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将 1 个图片框放在表单上并编写此代码
您还可以更改宽度和高度旁边的负数以获得最佳结果
putting 1 Picture box on the form and write this code
also you can change the the minus number beside of Width and Height to get best result
是的,没问题,您可以通过其 Region 属性为控件指定任意形状。将新类添加到您的项目中并粘贴下面所示的代码。编译。将新控件从工具箱顶部拖放到窗体上。
Yes, no problem, you can give a control an arbitrary shape with its Region property. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form.
圆形边缘与圆角一样吗?
如果是这样,请查看 http://social.msdn.microsoft.com/forums/en-US/winforms/thread/603084bb-1aae-45d1-84ae-8544386d58fd
Round edges as in round corners?
If so check out http://social.msdn.microsoft.com/forums/en-US/winforms/thread/603084bb-1aae-45d1-84ae-8544386d58fd
谢谢你,汉斯。但我也需要光滑的外观。我对这个主题做了一些研究,但找不到解决方案。然后我尝试自己做,找到了下面的解决方案。也许其他人需要它。
Thank you, Hans. But I also need a smooth look. I did some research on this subject, but I could not find a solution. Then I tried to do it myself and found the solution below. Maybe someone else needs it.