all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
21
Task/Yin-and-yang/Visual-Basic-.NET/yin-and-yang.visual
Normal file
21
Task/Yin-and-yang/Visual-Basic-.NET/yin-and-yang.visual
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Public Class Form1
|
||||
|
||||
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
|
||||
Dim g As Graphics = e.Graphics
|
||||
g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
|
||||
|
||||
DrawTaijitu(g, New Point(50, 50), 200, True)
|
||||
DrawTaijitu(g, New Point(10, 10), 60, True)
|
||||
End Sub
|
||||
|
||||
Private Sub DrawTaijitu(ByVal g As Graphics, ByVal pt As Point, ByVal width As Integer, ByVal hasOutline As Boolean)
|
||||
g.FillPie(Brushes.Black, pt.X, pt.Y, width, width, 90, 180)
|
||||
g.FillPie(Brushes.White, pt.X, pt.Y, width, width, 270, 180)
|
||||
g.FillEllipse(Brushes.Black, CSng(pt.X + (width * 0.25)), CSng(pt.Y), CSng(width * 0.5), CSng(width * 0.5))
|
||||
g.FillEllipse(Brushes.White, CSng(pt.X + (width * 0.25)), CSng(pt.Y + (width * 0.5)), CSng(width * 0.5), CSng(width * 0.5))
|
||||
g.FillEllipse(Brushes.White, CSng(pt.X + (width * 0.4375)), CSng(pt.Y + (width * 0.1875)), CSng(width * 0.125), CSng(width * 0.125))
|
||||
g.FillEllipse(Brushes.Black, CSng(pt.X + (width * 0.4375)), CSng(pt.Y + (width * 0.6875)), CSng(width * 0.125), CSng(width * 0.125))
|
||||
If hasOutline Then g.DrawEllipse(Pens.Black, pt.X, pt.Y, width, width)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Loading…
Add table
Add a link
Reference in a new issue