Lazyoval
#1
Ovals, well... lazy ovals.   


Code: (Select All)
'LazyOval
'this could be better... probably have rotozoom built in too

'demo
Screen _NewImage(800, 500, 32)
k& = _RGB32(200, 100, 50)

lazyoval 200, 200, 50, 30, k&


For h = 1 To 60
    _Limit 60
    Cls
    lazyoval 100, 100, h, 60, k&
    Circle (100, 100), 60, _RGB32(250, 250, 250)
    _Display
Next h
For h = 60 To 1 Step -1
    _Limit 30
    Cls
    lazyoval 100, 100, 60, h, k&
    Circle (100, 100), 60, _RGB32(250, 250, 250)
    _Display
Next h

For h = 1 To 60
    _Limit 60
    Cls
    lazyoval 100, 100, h, 60, k&
    _Display
Next h
For h = 60 To 1 Step -1
    _Limit 30
    Cls
    lazyoval 100, 100, 60, h, k&
    _Display
Next h
Cls
lazyoval 100, 100, 24, 80, k&
_PrintMode _KeepBackground
_PrintString (70, 92), "Lazyoval"
_Display

'the actual routine
Sub lazyoval (xx, yy, hh, ww, K As _Unsigned Long)
    'create a lazyoval by changing the ratio of a circle with the putimage command
    rr = hh
    If ww > rr Then rr = ww
    oo& = _NewImage(rr * 2 + 2, rr * 2 + 2, 32)
    _Dest oo&
    cx = rr
    cy = cx
    Circle (cx, cy), rr, K
    Paint (cx, cy), K, K
    x1 = xx - ww: x2 = xx + ww
    y1 = yy - hh: y2 = yy + hh
    _Dest 0
    _PutImage (x1, y1)-(x2, y2), oo&, 0, (0, 0)-(rr * 2, rr * 2)

    _FreeImage oo& 'don't delete this
End Sub
Reply


Messages In This Thread
Lazyoval - by James D Jarvis - 07-04-2022, 01:58 PM
RE: Lazyoval - by SierraKen - 07-09-2022, 06:37 PM
RE: Lazyoval - by James D Jarvis - 07-09-2022, 08:48 PM
RE: Lazyoval - by SierraKen - 07-10-2022, 09:00 PM



Users browsing this thread: 3 Guest(s)