文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C#brush的使用

C#brush的使用

时间:2010-08-31  来源:stublue

C#brush的使用

from:http://m.cnblogs.com/66756/1675787.html?full=1

 

private void Form1_Paint(object sender, PaintEventArgs e)
        {
     // (实心刷)
                  Rectangle  myrect1 = new Rectangle(20, 80, 250, 100);
                 SolidBrush  mysbrush1 = new SolidBrush(Color.DarkOrchid);                 
                 SolidBrush  mysbrush2 = new SolidBrush(Color.Aquamarine);     
                  SolidBrush  mysbrush3 = new SolidBrush(Color.DarkOrange);

     //(梯度刷)
                  LinearGradientBrush  mylbrush5 = new LinearGradientBrush(rect1,
                  Color.DarkOrange, Color.Aquamarine,
                  LinearGradientMode.BackwardDiagonal);

                 //(阴影刷)
                 HatchBrush  myhbrush5 = new HatchBrush(HatchStyle.DiagonalCross,
                  Color.DarkOrange, Color.Aquamarine);
                  HatchBrush  myhbrush2 = new HatchBrush(HatchStyle.DarkVertical,
                  Color.DarkOrange, Color.Aquamarine);
                  HatchBrush  myhbrush3 = new HatchBrush(HatchStyle.LargeConfetti,
                  Color.DarkOrange, Color.Aquamarine);

                 //(纹理刷)
                  TextureBrush textureBrush = new TextureBrush(new Bitmap(@"e:\123.jpg"));
                  e.Graphics.FillRectangle(mysbrush1, rect1);         // (实心刷)
       e.Graphics.FillRectangle(mylbrush1, rect1);            //(梯度刷)

              e.Graphics.FillRectangle(myhbrush1, rect1);             //(阴影刷)     
                 e.Graphics.FillRectangle(mytextureBrush, rect1);       //(纹理刷)

         }

LinearGradientBrush 类的命名空间为  System.Drawing.Drawing2D

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载