تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ممكن رسم سهم بهذا الكود
#3
Photo 
(23-04-17, 08:28 PM)abdalamask كتب : Imports System

   Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
Dim g As Graphics = e.Graphics
Dim pointF As New PointF(CSng(Me.Width) / 2F, CSng(Me.Height) / 2F)
Dim num1 As Single = Math.Min(pointF.X, pointF.Y)
Dim num2 As Single = CSng(CDbl(num1) * 65.0 / 100.0)
Dim num3 As Single = CSng(CDbl(num1) * 55.0 / 100.0)
Dim num4 As Single = CSng(CDbl(num1) * 45.0 / 100.0)
Dim _Brush As Brush = CType(New LinearGradientBrush(New Point(CInt(Math.Truncate(CDbl(pointF.X) - CDbl(num2))), CInt(Math.Truncate(CDbl(pointF.Y) - CDbl(num2)))), New Point(CInt(Math.Truncate(CDbl(pointF.X) + CDbl(num2))), CInt(Math.Truncate(CDbl(pointF.Y) + CDbl(num2)))), Color.WhiteSmoke, SystemColors.ControlDarkDark), Brush)
g.FillEllipse(_Brush, pointF.X - num2, pointF.Y - num2, 2F * num2, 2F * num2)
_Brush.Dispose()
If Me._Value Then
Dim path As New GraphicsPath()
path.AddEllipse(pointF.X - num1, pointF.Y - num1, num1 * 2F, num1 * 2F)
Dim pathGradientBrush As New PathGradientBrush(path)
pathGradientBrush.CenterColor = Color.FromArgb(150, CInt(Math.Truncate(Me.OnColor.R)), CInt(Math.Truncate(Me.OnColor.G)), CInt(Math.Truncate(Me.OnColor.B)))
Dim colorArray() As Color = { Color.FromArgb(1, CInt(Math.Truncate(Me.OnColor.R)), CInt(Math.Truncate(Me.OnColor.G)), CInt(Math.Truncate(Me.OnColor.B))) }
pathGradientBrush.SurroundColors = colorArray
g.FillEllipse(CType(pathGradientBrush, Brush), pointF.X - num1, pointF.Y - num1, num1 * 2F, num1 * 2F)
path.Dispose()
pathGradientBrush.Dispose()
End If
Dim brush2 As Brush = CType(New LinearGradientBrush(New Point(CInt(Math.Truncate(CDbl(pointF.X) - CDbl(num3))), CInt(Math.Truncate(CDbl(pointF.Y) - CDbl(num3)))), New Point(CInt(Math.Truncate(CDbl(pointF.X) + CDbl(num3))), CInt(Math.Truncate(CDbl(pointF.Y) + CDbl(num2)))), SystemColors.ControlDarkDark, Color.WhiteSmoke), Brush)
g.FillEllipse(brush2, pointF.X - num3, pointF.Y - num3, 2F * num3, 2F * num3)
_Brush.Dispose()
Dim gp As New GraphicsPath()
gp.AddEllipse(pointF.X - num4, pointF.Y - num4, 2F * num4, 2F * num4)
If Me._Value Then
Dim pathGradientBrush As New PathGradientBrush(gp)
pathGradientBrush.CenterColor = Color.WhiteSmoke
Dim colorArray() As Color = { Me.OnColor }
pathGradientBrush.SurroundColors = colorArray
pathGradientBrush.CenterPoint = New PointF(pointF.X - num4 / 2F, pointF.Y - num4 / 2F)
g.FillEllipse(CType(pathGradientBrush, Brush), pointF.X - num4, pointF.Y - num4, 2F * num4, 2F * num4)
pathGradientBrush.Dispose()
Else
Dim pathGradientBrush As New PathGradientBrush(gp)
pathGradientBrush.CenterColor = Color.WhiteSmoke
Dim colorArray() As Color = { Me.OffColor }
pathGradientBrush.SurroundColors = colorArray
pathGradientBrush.CenterPoint = New PointF(pointF.X - num4 / 2F, pointF.Y - num4 / 2F)
g.FillEllipse(CType(pathGradientBrush, Brush), pointF.X - num4, pointF.Y - num4, 2F * num4, 2F * num4)
pathGradientBrush.Dispose()
End If
gp.Dispose()
   End Sub

كما فى هذا الفيديو




هذا الكود رسم lad كيف احولة لرسم السهم كما فى الفيديو 

شكرااا
لقد ارفقت صورة محدد فيها السهم المحددشكرا على الاهتمام


الملفات المرفقة صورة/صور
   
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
ممكن رسم سهم بهذا الكود - بواسطة abdalamask - 23-04-17, 08:28 PM
RE: ممكن رسم سهم بهذا الكود - بواسطة abdalamask - 23-04-17, 11:06 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم