Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SUB that draws boxes with rounded corners.
#19
is this gonna be another 10 page arms race? let me throw mine in then

Code: (Select All)
sub cboxf (x, y, w, h, r, c as _unsigned long)
    x0 = r
    y0 = 0
    e = -r

    do while y0 < x0
        if e <= 0 then
            y0 = y0 + 1
            line (x + r - x0, y + r - y0) - (x + w - r + x0, y + r - y0), c, bf
            line (x + r - x0, y + h - r + y0) - (x + w - r + x0, y + h - r + y0), c, bf
            e = e + 2*y0
        else
            line (x + r - y0, y + r - x0) - (x + w - r + y0, y + r - x0), c, bf
            line (x + r - y0, y + h - r + x0) - (x + w - r + y0, y + h - r + x0), c, bf
            x0 = x0 - 1
            e = e - 2*x0
        end if
    loop
    line (x, y + r)-step(w, h - 2*r), c, bf
end sub
Reply


Messages In This Thread
RE: SUB that draws boxes with rounded corners. - by vince - 09-15-2024, 05:43 AM



Users browsing this thread: 11 Guest(s)