Japt

GDI PokeBall - VB.NET

Jul 18th, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. Private Sub DrawPokeBall(g As Graphics, x As Integer, y As Integer, size As Integer)
  2.  
  3. Dim B_ As SmoothingMode = g.SmoothingMode
  4. Dim E_ As New SolidBrush(Color.FromArgb(210, 210, 210))
  5. Dim N_ As New SolidBrush(Color.FromArgb(200, 0, 0))
  6.  
  7. Dim I_ As New Rectangle(x, y, size, size)
  8. Dim S_ As Integer = size \ 2
  9.  
  10. Dim A_ As Integer = CInt(Math.Max(size * 0.05, 3))
  11.  
  12. Dim P_ As New LinearGradientBrush(I_, Color.Red, Color.FromArgb(150, 0, 0), 90.0F)
  13. Dim O_ As Integer = CInt((S_ * 1.1) / 2)
  14. Dim K_ As New Rectangle(x + (O_ \ 2) + A_, y + (O_ \ 2) - A_, O_, O_)
  15. Dim E__ As New LinearGradientBrush(K_, Color.FromArgb(30, 255, 255, 255), Color.FromArgb(5, 255, 255, 255), 60.0F)
  16. Dim M_ As New Pen(Color.Black, A_)
  17. Dim O__ As Integer = y + (size \ 2)
  18. Dim N__ As Integer = A_ * 2
  19.  
  20. Dim N___ As Integer = A_ \ 2
  21. Dim O___ As Integer = size \ 3
  22. Dim O____ As Integer = (size \ 2) - (O___ \ 2)
  23. Dim B__ As New LinearGradientBrush(I_, Color.White, Color.FromArgb(220, 220, 220), 90.0F)
  24.  
  25. g.SmoothingMode = SmoothingMode.AntiAlias
  26. g.FillEllipse(B__, I_)
  27. g.FillEllipse(E_, x + O____ - N___, y + O____ - N___, O___ + A_, O___ + A_)
  28. g.SetClip(New Rectangle(x, y, size, size \ 2))
  29. g.FillEllipse(P_, I_)
  30. g.FillEllipse(N_, x + O____ - N___, y + O____ - N___, O___ + A_, O___ + A_)
  31. g.ResetClip()
  32. g.FillEllipse(E__, K_)
  33. g.DrawEllipse(Pens.Black, I_)
  34.  
  35. Dim X_ As Integer = O___ - (N__)
  36. Dim X__ As Integer = (size \ 2) - (X_ \ 2)
  37.  
  38. g.SmoothingMode = SmoothingMode.None
  39. g.DrawLine(M_, x, O__, x + size, O__)
  40. g.SmoothingMode = SmoothingMode.AntiAlias
  41. g.FillEllipse(Brushes.Black, x + O____, y + O____, O___, O___)
  42. g.FillEllipse(Brushes.White, x + X__, y + X__, X_, X_)
  43.  
  44. X_ -= A_
  45. X__ += (A_ \ 2)
  46.  
  47. Dim X___ As New Rectangle(x + X__, y + X__, X_, X_)
  48. Dim X____ As New LinearGradientBrush(X___, Color.FromArgb(220, 220, 220), Color.White, 90.0F)
  49.  
  50. g.FillEllipse(X____, X___)
  51. g.DrawEllipse(Pens.White, x + X__, y + X__, X_, X_)
  52. g.DrawEllipse(Pens.Black, x + X__ - 1, y + X__ - 1, X_ + 2, X_ + 2)
  53. g.SmoothingMode = B_
  54.  
  55. X____.Dispose()
  56. P_.Dispose()
  57. B__.Dispose()
  58. E__.Dispose()
  59. M_.Dispose()
  60. E_.Dispose()
  61. N_.Dispose()
  62. End Sub
Add Comment
Please, Sign In to add comment