while lDY >= 0 Pixel(lX1,lY1) = ForegroundColourIndex if lP > 0 then lX1 = lX1 + lXIncrement lY1 = lY1 + lYIncrement lP = lP + lDPru else lY1 = lY1 + lYIncrement lP = lP + lDPr end if lDY = lDY - 1 wend end if
end sub
public sub Rectangle(ByVal lX1,ByVal lY1,ByVal lX2,ByVal lY2) ' Easy as pie, well, actually pie is another function... draw four lines Line lX1,lY1,lX2,lY1 Line lX2,lY1,lX2,lY2 Line lX2,lY2,lX1,lY2 Line lX1,lY2,lX1,lY1 end sub
public sub Circle(ByVal lX,ByVal lY,ByVal lRadius) Ellipse lX,lY,lRadius,lRadius end sub
' Bresenham ellispe, pretty quick also, uses reflection, so rotation is out of the ' question unless we perform a matrix rotation after rendering the ellipse coords public sub Ellipse(ByVal lX,ByVal lY,ByVal lRadiusX,ByVal lRadiusY) ' Draw a circle at point lX,lY with radius lRadius Dim lAlpha,lBeta,S,T,lTempX,lTempY