تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مخطط
#4
النسبة المئوية هي اللي باللون الأحمر (وعدلت الدالة عشان تتلافى مشكلة تطابق الصفر وال100 على الدائرة)

[COLOR="#FF0000"]تلاحظ ان الجزء التالي يبدأ من نهاية اللي قبله
[/COLOR]

كود :
Option Explicit


Private Sub Command1_Click()
   Call DrawPiePiece(Picture1, 100, 100, 60, [color=#ff0000]0[/color], [color=#ff0000]36[/color], QBColor(9), QBColor(9))
   Call DrawPiePiece(Picture1, 100, 100, 60, [color=#ff0000]36[/color], [color=#ff0000]55[/color], QBColor(10), QBColor(10))
   Call DrawPiePiece(Picture1, 100, 100, 60, [color=#ff0000]55[/color], [color=#ff0000]75[/color], QBColor(11), QBColor(11))
   Call DrawPiePiece(Picture1, 100, 100, 60, [color=#ff0000]75[/color], [color=#ff0000]100[/color], QBColor(12), QBColor(12))
  
   Call DrawPiePiece(Picture1, 250, 100, 60, [color=#ff0000]0[/color], [color=#ff0000]36[/color], vbBlack, QBColor(9))
   Call DrawPiePiece(Picture1, 250, 100, 60, [color=#ff0000]36[/color], [color=#ff0000]55[/color], vbBlack, QBColor(10))
   Call DrawPiePiece(Picture1, 250, 100, 60, [color=#ff0000]55[/color], [color=#ff0000]75[/color], vbBlack, QBColor(11))
   Call DrawPiePiece(Picture1, 250, 100, 60, [color=#ff0000]75[/color], [color=#ff0000]100[/color], vbBlack, QBColor(12))

End Sub



Public Sub DrawPiePiece(pic As PictureBox, x As Integer, y As Integer, radius As Integer, [color=#ff0000]fStart [/color]As Double, [color=#ff0000]fEnd [/color]As Double, lineColor As Long, fillColor As Long)
   If fStart=0 Then fStart= 0.001
   If fStart=100 Then fStart= 99.999
   If fEnd=0 Then fEnd= 0.001
   If fEnd=100 Then fEnd= 99.999
   Const PI As Double = 3.14159265359
   pic.ScaleMode = vbPixels
  
   Dim CircleEnd As Double
   CircleEnd = -2 * PI
  
   pic.fillColor = fillColor
   pic.FillStyle = 0
  
   Dim dStart As Double
   Dim dEnd As Double
   dStart = fStart * (CircleEnd / 100)
   dEnd = fEnd * (CircleEnd / 100)
  
   pic.Circle (x, y), radius, lineColor, dStart, dEnd
End Sub
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
مخطط - بواسطة asto - 29-08-13, 05:46 AM
مخطط - بواسطة MSDOS - 29-08-13, 11:23 AM
مخطط - بواسطة asto - 29-08-13, 05:43 PM
مخطط - بواسطة MSDOS - 29-08-13, 05:56 PM
مخطط - بواسطة asto - 29-08-13, 06:54 PM
مخطط - بواسطة MSDOS - 29-08-13, 07:10 PM
مخطط - بواسطة asto - 30-08-13, 01:19 AM

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


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