Here's a way to make the filled rounded rects using the 'fatSuperEllipse' function. [code] AppTitle "Rounded Rects Using Fat Super Ellipse" Global sw%, sh% screenSize(1) ClsColor 255,240,200 Cls SeedRnd MilliSecs() st = MilliSecs() numRects% = 200 ; <----- change number of rounded rects here For i% = 0 To numRects - 1 Color Rand(0,192), Rand(0,192), Rand(0,192) wd% = Rand(15,35) ;random widths (x radius) hi% = Rand(5,10) ;random heights (y radius) cx% = Rand(wd+2,sw-wd-2) ;random center x cy% = Rand(hi+2,sh-hi-2) ;random center y ex# = Rnd(5.0, 99.0) ;random exponent sg% = 10 ;10 line segments per rect (fewer is faster) ps% = Rand(5,10) ;random pen size (line thickness) fillRect% = 1 ;always fill rounded rects fatSuperEllipse(cx, cy, wd, hi, ex, sg, ps, fillRect) Next et = MilliSecs()-st Color 0,0,0 fatSuperEllipse(sw/2, sh-20, 133, 7, 19.0, 10, 14, 0) Color 255,200,64 Text sw/2,sh-27,"Avg time per rounded rect: "+et/Float(numRects) +"ms", True, False Flip WaitMouse() End ;rotation was stripped from this function to allow using 'Rect' to fill rounded rects Function fatSuperEllipse (centerX%, centerY%, xRadius%, yRadius%, exponent#, numSegs%, penSize%, fill% = 0) If numSegs% >=2 Then detail# = 360.0/Float(numSegs%) Else detail# = 180.0 End If If exponent# = 2.0 Or exponent# = 0.0 Then power# = 0.0 Else power# = 2.0/exponent#-1 End If x1% = xRadius% * 1.0^power# + centerX% y1% = centerY% theta# = detail# limit# = 360.0 + detail# While theta# <= limit# cosTheta# = Cos(theta#) sinTheta# = Sin(theta#) x2% = xRadius% * cosTheta# * Abs(cosTheta#)^power# + centerX% y2% = yRadius% * sinTheta# * Abs(sinTheta#)^power# + centerY% fatLine (x1%, y1%, x2%, y2%, penSize%) x1% = x2% y1% = y2% theta# = theta# + detail# Wend If fill% = 1 Then Rect centerX-xRadius, centerY-yRadius, xRadius * 2, yRadius * 2, True End If End Function Function fatLine(x1%, y1%, x2%, y2%, penSize%) If penSize% < 1 Then Return False If penSize% = 1 Then Line(x1%, y1%, x2%, y2%): Return offset% = penSize% Shr 1 deltax% = Abs(x2% - x1%) deltay% = Abs(y2% - y1%) If deltax% >= deltay% Then numovals% = deltax% + 1 d% = (2 * deltay%) - deltax% dinc1% = deltay% Shl 1 dinc2% = (deltay% - deltax%) Shl 1 xinc1% = 1 xinc2% = 1 yinc1% = 0 yinc2% = 1 Else numovals% = deltay% + 1 d% = (2 * deltax%) - deltay% dinc1% = deltax% Shl 1 dinc2% = (deltax% - deltay%) Shl 1 xinc1% = 0 xinc2% = 1 yinc1% = 1 yinc2% = 1 End If If x1% > x2% Then xinc1% = - xinc1% xinc2% = - xinc2% End If If y1% > y2% Then yinc1% = - yinc1% yinc2% = - yinc2% End If x% = x1% - offset% y% = y1% - offset% For i% = 1 To numovals% Oval x%, y%, penSize%, penSize%, 1 If d% < 0 Then d% = d% + dinc1% x% = x% + xinc1% y% = y% + yinc1% Else d% = d% + dinc2% x% = x% + xinc2% y% = y% + yinc2% End If Next End Function Function screenSize%(screen%) Select screen Case 1: sw% = 800: sh% = 600 Case 2: sw% = 1024: sh% = 768 Case 3: sw% = 1280: sh% = 1024 Case 4: sw% = 1600: sh% = 1200 End Select Graphics sw, sh , 32, 2 SetBuffer BackBuffer() End Function[/code] This post is from -- http://socoder.net/index.php?topic=1231