如何在Winforms中为矩形添加5px [英] How to add 5px for a rectangle in Winforms
本文介绍了如何在Winforms中为矩形添加5px的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Winforms中为矩形添加5px(或10px).我该怎么办?
请帮帮我.
非常感谢.
I want to add 5px(or 10px) for a rectangle in winforms.How can I do ?
Please help me.
Many thanks.
推荐答案
尝试:
Try:
Rectangle rect = new Rectangle(0, 0, 100, 100);
rect.Inflate(5, 5);
将在每个方向上将矩形扩大5像素.
Will enlarge the Rectangle by 5 px in each direction.
这篇关于如何在Winforms中为矩形添加5px的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文