I'd like to create a fatBox rectangle with rounded corners (fill should be optional). The following 2 functions are fatBox and RoundedRect. The fatBox gives me a fat border around a rectangle, and RoundedRect gives me rounded corners but with a thin border. I'm intending to use fatBoxs for buttons, or for display purposes. Any help on combining fatBox and RoundedRect would be appreciated. [code] ;********************************** fatBox ****************************************** ;** Parameters are: ** ;** x%, y%, wide%, high%, penSize%, rotAngle% ** ;** ** ;** x%, y% are the coords of the upper left corner of the box to be plotted ** ;** this function rotates box around the upper left corner (not center of box) ** ;** wide% is the width of the box ** ;** high% is the height of the box ** ;** penSize% is the thickness of lines used to plot box ** ;** rotAngle% is the rotation angle of the box to be plotted (0 to 360 typically) ** ;** ** ;***************************************************************************************** Function fatBox(x%, y%, wide%, high%, penSize%, rotAngle%) If rotAngle > 360 Then rotAngle = rotAngle Mod 360 ;No rotation involved, so just draw a box If rotAngle% = 0 Or rotAngle% = 360 Then fatLine(x% , y% , x% + wide%, y% , penSize%) fatLine(x% + wide%, y% , x% + wide%, y% + high%, penSize%) fatLine(x% , y% + high%, x% + wide%, y% + high%, penSize%) fatLine(x% , y% , x%, y% + high%, penSize%) Else ;Make rotation calculations and draw rotated box vtx% = rotAngle% + 90 cs% = Cos(vtx%) * high% sn% = Sin(vtx%) * high% x1% = Cos(rotAngle%)* wide% + x% y1% = Sin(rotAngle%)* wide% + y% fatLine(x%, y%, x1%, y1%, penSize%) x2% = cs% + x1% y2% = sn% + y1% fatLine(x1%, y1%, x2%, y2%, penSize%) x3% = cs% + x% y3% = sn% + y% fatLine(x%, y%, x3%, y3%, penSize%) fatLine(x2%, y2%, x3%, y3%, penSize%) End If End Function Function RoundedRect(x,y,w,h,radius#,fill=1) ;Draws a rectangle with rounded edges of specified radius If radius>w/2 Then radius=w/2 If radius>h/2 Then radius=h/2 If fill Rect x+radius,y,w-radius*2,h Rect x,y+radius,w,h-radius*2 Oval x,y,radius*2,radius*2 Oval x+w-radius*2,y,radius*2,radius*2 Oval x,y+h-radius*2,radius*2,radius*2 Oval x+w-radius*2,y+h-radius*2,radius*2,radius*2 Else Line x+radius,y,x+w-radius,y Line x,y+radius,x,y+h-radius Line x+radius,y+h,x+w-radius,y+h Line x+w,y+radius,x+w,y+h-radius ang#=0 r=ColorRed():g=ColorGreen():b=ColorBlue() LockBuffer GraphicsBuffer() Repeat If ang<90 WritePixelFast x+w-radius+radius*Sin(ang),y+radius-radius*Cos(Ang), getrgb(r,g,b), buffer ElseIf ang<180 WritePixelFast x+w-radius+radius*Sin(ang),y+h-radius-radius*Cos(Ang), getrgb(r,g,b), buffer ElseIf ang<270 WritePixelFast x+radius+radius*Sin(ang),y+h-radius-radius*Cos(Ang), getrgb(r,g,b), buffer Else WritePixelFast x+radius+radius*Sin(ang),y+radius-radius*Cos(Ang), getrgb(r,g,b), buffer End If ang=ang+45/radius Until ang#=>360 UnlockBuffer GraphicsBuffer() End If End Function [/code] This post is from -- http://socoder.net/index.php?topic=1231