public sub Polygon(aX,aY,bJoin) Dim iTemp Dim lUpper
if UBound(aX) <> UBound(aY) then exit sub if UBound(aX) < 1 then exit sub ' Must be more than one point
lUpper = UBound(aX) - 1
' Draw a series of lines from arrays aX and aY for iTemp = 1 to lUpper Line aX(iTemp - 1),aY(iTemp - 1),aX(iTemp),aY(iTemp) next
if bJoin then Line aX(lUpper),aY(lUpper),aX(0),aY(0) end if end sub
' Easy as, err, rectangle? public sub PieSlice(lX,lY,lRadius,sinStartAngle,sinArcAngle,bFilled) Dim sinActualAngle Dim sinMidAngle Dim lX2 Dim lY2 Dim iTemp
Arc lX,lY,lRadius,lRadius,sinStartAngle,sinArcAngle AngleLine lX,lY,lRadius,sinStartAngle sinActualAngle = sinStartAngle + sinArcAngle if sinActualAngle > 360 then sinActualAngle = sinActualAngle - 360 end if AngleLine lX,lY,lRadius,sinActualAngle ' Now pick a start flood point at the furthest point from the center ' Divide the arc angle by 2 sinMidAngle = sinStartAngle + (sinArcAngle / 2)
if sinMidAngle > 360 then sinMidAngle = sinMidAngle - 360 end if
if bFilled then for iTemp = 1 to lRadius - 1 lY2 = CInt(lY + (Sin(DegreesToRadians(sinMidAngle)) * iTemp)) lX2 = CInt(lX + (Cos(DegreesToRadians(sinMidAngle)) * iTemp))