可通过钢笔和笔刷混合 使用绘制出有边框的填充图案,如图:

GDI+ 钢笔和笔刷同时使用

代码如下:

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g 
= e.Graphics;
            HatchBrush hb 
= new HatchBrush(HatchStyle.NarrowHorizontal, Color.Blue, Color.White);
            LinearGradientBrush lgb 
= new LinearGradientBrush(new Point(22), new Point(192), Color.Blue, Color.Brown);
            Pen hp 
= new Pen(lgb,10);
            g.DrawRectangle(hp, 
20,20120,120);
            g.FillRectangle(hb,
30,30,100,100);
        }

相关文章:

  • 2021-07-08
  • 2021-05-24
  • 2021-07-19
  • 2021-11-28
  • 2021-05-23
  • 2021-08-22
  • 2021-11-28
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-02-04
相关资源
相似解决方案