画笔对象,画刷对象

 
  1.         Dim mypen As New Pen(Color.Red, 10)     '定义以红色为线条,10个像素粗的画笔对象
  2.         Dim g As Graphics = Me.CreateGraphics
  3.         g.DrawEllipse(mypen, 10, 10, 100, 100)  '画正圆
  4. '---------------------------------
  5.          Dim mypen As New Pen(Color.blue, 10)    '定义以蓝色为线条的画笔对象
  6.          Dim g As Graphics = Me.CreateGraphics
  7.         g.DrawEllipse(mypen, 10, 10, 100, 200)  '画椭圆
  8. '---------------------------------
  9. 最大限度的填充一个黄色的椭圆
  10. Dim mybrush As New SolidBrush(Color.Yellow)
  11.         Dim g As Graphics = Me.CreateGraphics
  12.         g.FillEllipse(mybrush, ClientRectangle)
  13. '--------------------------------
  14. 直接在窗体上绘制文本
  15. Dim afont As New System.Drawing.Font("arial", 22, FontStyle.Bold)
  16.         Dim g As Graphics = Me.CreateGraphics
  17.         g.DrawString("Graphics are fun!", afont, Brushes.Brown, 20, 10)
  18.         g.DrawString("Keenweiwei!", afont, Brushes.BlueViolet, 40, 40)
  19. '--------------------------
  20. 旋转文本
  21. 'g.RotateTransform(20)           '顺时针旋转20度
  22.         'g.DrawString("Tuo JINGJING!", afont, Brushes.DeepPink, 100, 40)
  23.         g.RotateTransform(-20)           '逆时针旋转20度
  24.         g.DrawString("Tuo JINGJING!", afont, Brushes.DeepPink, 40, 150)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值