REM Created in CorelPhotoPaint Version 9.397 REM Created On December 1, 1999 by linkaxdx REM General Polygon REM Subroutine needs x & y pt. for the center, the size of the REM radius to a vertex and the number of sides (3 or greater) ' polyx.csc WITHOBJECT "CorelPhotoPaint.Automation.9" .SetDocumentInfo 1200, 1200 ' 4 x 4 inch at 300 dpi cx& = 600 cy& = 600 GLOBAL CONST pi AS DOUBLE = 3.1415926535 SUB pNRing ( ByVal pRX&, ByVal pRY&, ByVal pRR&, ByVal pN) DIM xA(pN) AS DOUBLE DIM yA(pN) AS DOUBLE xrad = -pi/2*pN ' -pi/2*pN, or pi/2*pN to flip horizontally FOR K = 1 TO pN xA(K) = 256*pRX& + 256*pRR&*cos(xrad) xrad = xrad + 2*pi/pN NEXT K xrad = -pi/2*pN FOR L = 1 TO pN yA(L) = 256*pRY& + 256*pRR&*sin(xrad) xrad = xrad + 2*pi/pN NEXT L .PolygonTool 1, 0, 0, 0, TRUE, FALSE, FALSE .SetPaintColor 5, 0, 0, 0, 0 .StartDraw xA(1), yA(1), 0, 0, 0, 0 For z = 2 TO pN .ContinueDraw xA(z), yA(z), 0, 0, 0, 0 Next z .EndDraw END SUB Msg$ = "Enter number of polygon sides" uix$ = INPUTBOX(Msg$) px& = VAL(uix$) IF px = 0 THEN px = 5 ' subroutine call in the line below requires: ' x & y value of polygon center, the radius to a vertex, ' and the number of equal sides (3 or greater) pNRing cx&, cy&, 200, px END WITHOBJECT