相关疑难解决方法(0)

图片框中的圆角边缘C#

如何在图片框控件中舍入边缘.我想获得像椭圆这样的角度,但我不知道该怎么做.我用C#.谢谢!

c# picturebox edges

12
推荐指数
3
解决办法
3万
查看次数

带有光滑圆角的标签

窗口形式的 2 个标签

两个标签都有AutoSizetrue 和TextAlignMiddleCenter。

label2 如何也能显示平滑的边框?

这是处理程序Form.Load(...)&的测试代码Form.Paint(...):

int _cornerRadius = 10;
Point _locationLabel2;

// Form.Load(...)
private void Form3_Load(object sender, EventArgs e)
{
    // Step 1: Cut the label regions (seems to be ok, result is the same for both labels)
    GraphicsPath graphicsPath = _getRoundPath(label1.ClientRectangle, _cornerRadius);
    label1.Region = new Region(graphicsPath);
    graphicsPath = _getRoundPath(label2.ClientRectangle, _cornerRadius);
    label2.Region = new Region(graphicsPath);

    _locationLabel2 = this.PointToClient(label2.Parent.PointToScreen(label2.Location));
}

// Form.Paint(...)
private void Form3_Paint(object sender, PaintEventArgs e)
{
    using (Pen pen = …
Run Code Online (Sandbox Code Playgroud)

c# graphics controls panel winforms

4
推荐指数
1
解决办法
9385
查看次数

标签 统计

c# ×2

controls ×1

edges ×1

graphics ×1

panel ×1

picturebox ×1

winforms ×1