Winforms 在列表中选择朋友时,如何实现Skype中使用的蓝色背景?
我想这是使用了梯度王,但我不知道。 我想在我的WinForms应用程序中使用相同的功能Winforms 在列表中选择朋友时,如何实现Skype中使用的蓝色背景?,winforms,colors,skype,Winforms,Colors,Skype,我想这是使用了梯度王,但我不知道。 我想在我的WinForms应用程序中使用相同的功能 最简单的方法是使用类似Paint.Net的程序获取图形中使用的颜色的RGB值 以面板为例: void panel1_Paint(object sender, PaintEventArgs e) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; using (LinearGradientBrush br = new LinearGradient
最简单的方法是使用类似Paint.Net的程序获取图形中使用的颜色的RGB值 以面板为例:
void panel1_Paint(object sender, PaintEventArgs e) {
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
using (LinearGradientBrush br = new LinearGradientBrush(
panel1.ClientRectangle,
Color.FromArgb(52, 151, 254),
Color.FromArgb(61, 129, 243),
LinearGradientMode.Vertical)) {
e.Graphics.FillRectangle(br, panel1.ClientRectangle);
}
using (Pen p = new Pen(Color.FromArgb(37, 110, 184), 2)) {
e.Graphics.DrawRectangle(p, 0, 0,
panel1.ClientSize.Width - 1,
panel1.ClientSize.Height - 1);
}
}
结果:
非常接近原作。您可以通过调亮或调暗所使用的颜色来进行调整