تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ممكن رسم سهم بهذا الكود
#6
نفذ الكود هذا في مشروع منفصل حتي تتضح لك الفكرة

وعندما توضح لي مكان رسم السهم بالظبط
سوف أوضح لك كيف تدمج الكود الخاص بي مع الكود الخاص بك
إن أردت ان تتخلص من ذيل السهم عليك ان تجعل القيمة 0.3F = 0.7F او العكس

PHP كود :
Public Class Form1

    Private Sub GetArrowPath
(path As Drawing2D.GraphicsPathrect As Rectangledirection As Directions)
 
       Dim rectF As RectangleF RectangleF.Inflate(rect, -4.0F, -4.0F)
 
       Dim x As Single = (rectF.rectF.Width 2.0F)
 
       Dim y As Single = (rectF.rectF.Height 2.0F)
 
       path.StartFigure()
 
       path.AddLines(New PointF() {
 
                     New PointF(xrectF.Top),
 
                     New PointF(rectF.Right, (rectF.rectF.Height 0.7F)),
 
                     New PointF((rectF.rectF.Width 0.7F), (rectF.rectF.Height 0.7F)),
 
                     New PointF((rectF.rectF.Width 0.7F), rectF.Bottom),
 
                     New PointF((rectF.rectF.Width 0.3F), rectF.Bottom),
 
                     New PointF((rectF.rectF.Width 0.3F), (rectF.rectF.Height 0.7F)),
 
                     New PointF(rectF.Left, (rectF.rectF.Height 0.7F))})
 
       path.CloseAllFigures()
 
       Dim matrix As Drawing2D.Matrix = New Drawing2D.Matrix()
 
       Select Case direction
            Case Directions
.East
                matrix
.RotateAt(90.0F, New PointF(xy))
 
           Case Directions.South
                matrix
.RotateAt(180.0F, New PointF(xy))
 
           Case Directions.West
                matrix
.RotateAt(270.0F, New PointF(xy))
 
       End Select
        path
.Transform(matrix)
 
   End Sub

    Protected Overrides Sub OnPaint
(As PaintEventArgs)
 
       MyBase.OnPaint(e)
 
       e.Graphics.SmoothingMode =Drawing2D.SmoothingMode.AntiAlias
        Dim r 
As Rectangle = New Rectangle(1010100100)
 
       Dim p As Drawing2D.GraphicsPath = New Drawing2D.GraphicsPath
        GetArrowPath
(prDirections.East)

 
       Using sb As New SolidBrush(Color.Black)
 
           e.Graphics.FillPath(sbp)
 
       End Using
    End Sub

    Public Enum Directions
        North
        East
        South
        West
    End Enum
End 
Class 
الرد }}}
تم الشكر بواسطة:


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


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


يقوم بقرائة الموضوع: