Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Boxing accident
#1
So writing a sub to draw rectangles with line thickness and the first one I knocked out revealed a curious and happy surprise:


Code: (Select All)
'Boxing accident
Screen _NewImage(800, 500, 32)
Dim Shared pencolor As _Unsigned Long
pencolor = _RGB32(250, 250, 250)

box 2, 2, 140, 80, 3, &HFFFFFFFF

box 152, 2, 250, 100, 3, &HFF

box 300, 2, 400, 200, 9, &HF0F0F0F

box 30, 200, 90, 400, 20, &HF00F00F

Locate 20, 20: Print "A happy accident using line styles"
Locate 21, 20: Print "and a simple algorithm"
Sub box (x1, y1, x2, y2, thickness, style)
    xa = x1: xb = x2: ya = y1: yb = y2
    For l = 1 To thickness
        Line (xa, ya)-(xb, yb), pencolor, B , style
        xa = xa + 1: xb = xb - 1
        ya = ya + 1: yb = yb - 1
    Next l
End Sub
Reply


Messages In This Thread
Boxing accident - by James D Jarvis - 05-14-2022, 03:01 PM
RE: Boxing accident - by Pete - 07-03-2024, 10:39 PM
RE: Boxing accident - by grymmjack - 07-04-2024, 02:21 PM
RE: Boxing accident - by Pete - 07-04-2024, 05:05 PM
RE: Boxing accident - by James D Jarvis - 07-17-2024, 06:12 PM
RE: Boxing accident - by Pete - 07-17-2024, 06:34 PM
RE: Boxing accident - by James D Jarvis - 07-17-2024, 07:45 PM
RE: Boxing accident - by Pete - 07-17-2024, 07:49 PM



Users browsing this thread: 1 Guest(s)