Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QuadDraw revisited - drawing program work in progress
#1
Browsing through the old forum @luke put up temporarily I found a drawing program I forgot about, QuadDraw, and decided to reawaken it.  It would not work in our current QB64 version so I had to rewrite how it draws (it was using a recursive function that worked in QB64 v1.5 but not v2).  Used a drawing method @bplus helped me with with another drawing project (doodle dandy).

I'm going to start working on this again and add more features.  Here's where it's at so far.  Draw on the screen by left clicking the mouse.  Right clicking will fill spaces with a random color.  U will undo last change.  Brush size can be changed with -/+ keys.  You can change how many section to draw at once by pressing numbers 1 to 4.  Current drawing settings are visible in the title bar.  I probably add a menu system and drawing color selector to it next.

Testers and suggestions are welcomed.  Example drawing is attached.

- Dav


Code: (Select All)
'============
'QuadDraw.bas v1.3
'============
'An odd little drawing program.
'Draws/paints in 4 sections of the screen at same time.
'Coded by Dav for QB64 APR/2022

'NEW FOR v1.3:  Fixed it to run in QB64 v2 and higher.
'               (had to remove recursive drawing function)

'               Screen size now adjusts to users desktop resolution.
'               (size not hard coded - should look good on most desktops)

'CREDITS: SPAINT SUB was made by Petr.  Thanks Petr!
'         And bplus helped me figure out a way to draw lines without gaps
'         in another program (doodle dandy). I used that new method here.

'----------
'HOW TO USE:
'----------
'Use the mouse to draw/color on screen.
'Left click = draws on screen.
'Right click = fills areas with color.
'Use the +/- keys to change brush size (1 to 50 allowed)
'Press 1,2,3 or 4 to set how many areas to draw in, default is 4.
'Press U to undo last change.
'Space = clears screen and starts over.
'ESC = Ends program

'Current drawing settings are shown in title bar

DIM SHARED quads, brushsize

SCREEN _NEWIMAGE(_DESKTOPWIDTH * .75, _DESKTOPHEIGHT * .85, 32)
_DELAY .25

centerx = _WIDTH / 2: centery = _HEIGHT / 2 'center point of screen

wht& = _RGB(255, 255, 255) 'used often, so variable it
blk& = _RGB(0, 0, 0)
brushsize = 5 'size of drawing circle (brush)
quads = 4 'start with 4 drawing sections

CLS , wht& 'start with white screen

undo& = _COPYIMAGE(_DISPLAY)

'====
main:
'====

_TITLE "QuadDraw - Quads:" + STR$(quads) + "  BrushSize:" + STR$(brushsize)

DO

    WHILE _MOUSEINPUT: WEND

    mx = _MOUSEX: my = _MOUSEY

    IF _MOUSEBUTTON(1) THEN

        IF stilldown = 0 THEN
            _FREEIMAGE undo&
            undo& = _COPYIMAGE(_DISPLAY)
        END IF

        IF stilldown = 1 THEN
            stepx = lastmx - mx
            stepy = lastmy - my
            length = INT((stepx ^ 2 + stepy ^ 2) ^ .5)
            dx = stepx / length
            dy = stepy / length
            FOR i = 0 TO length
                FOR d = 1 TO brushsize
                    newx = mx + dx * i: newy = my + dy * i
                    CIRCLE (newx, newy), d, blk&: PAINT (newx, newy), blk&, blk&
                    IF quads > 1 THEN
                        CIRCLE (centerx - newx + centerx, centery - newy + centery), d, blk&
                        PAINT (centerx - newx + centerx, centery - newy + centery), blk&, blk&
                    END IF
                    IF quads > 2 THEN
                        CIRCLE (newx, centery - newy + centery), d, blk&
                        PAINT (newx, centery - newy + centery), blk&, blk&
                    END IF
                    IF quads > 3 THEN
                        CIRCLE (centerx - newx + centerx, newy), d, blk&
                        PAINT (centerx - newx + centerx, newy), blk&, blk&
                    END IF
                NEXT
            NEXT
        ELSE
            FOR d = 1 TO brushsize STEP .2
                CIRCLE (mx, my), d, blk&&
            NEXT
        END IF
        lastmx = mx: lastmy = my
        stilldown = 1
    ELSE
        stilldown = 0
    END IF

    'if right click, fill sections with random color
    IF _MOUSEBUTTON(2) THEN

        _FREEIMAGE undo&
        undo& = _COPYIMAGE(_DISPLAY)

        r = RND * 255: g = RND * 255: b = RND * 255

        SPAINT mx, my, _RGB(r, g, b) ', blk&
        IF quads > 1 THEN
            SPAINT centerx - mx + centerx, centery - my + centery, _RGB(r, g, b) ', blk&
        END IF
        IF quads > 2 THEN
            SPAINT mx, centery - my + centery, _RGB(r, g, b) ', blk&
        END IF
        IF quads > 3 THEN
            SPAINT centerx - mx + centerx, my, _RGB(r, g, b) ', blk&
        END IF
        WHILE _MOUSEBUTTON(2) <> 0: n = _MOUSEINPUT: WEND
    END IF

    'get keyboard input
    key$ = UCASE$(INKEY$)
    IF key$ <> "" THEN
        SELECT CASE key$
            CASE CHR$(32): CLS , wht& 'scpace clears screen again
            CASE "1": quads = 1
            CASE "2": quads = 2
            CASE "3": quads = 3
            CASE "4": quads = 4
            CASE "+"
                brushsize = brushsize + 1: IF brushsize > 50 THEN brushsize = 50
            CASE "-"
                brushsize = brushsize - 1: IF brushsize < 1 THEN brushsize = 1
            CASE "U": _PUTIMAGE (0, 0), undo&
            CASE CHR$(27): END
        END SELECT
        DO UNTIL INKEY$ = "": LOOP
        GOTO main
    END IF

LOOP

END

SUB SPAINT (x AS INTEGER, y AS INTEGER, clr~&) 'Color everything in the X, Y position regardless of the border color.
    'SUB by Petr
    DIM m AS _MEM, m2 AS _MEM

    m = _MEMIMAGE(_DEST)
    W = _WIDTH(_DEST)
    H = _HEIGHT(_DEST)
    P = _PIXELSIZE(_DEST)

    SELECT CASE P
        CASE 4 '                             image is 32 bit image
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB32(1, 1, 1)
            Empty~& = _RGBA32(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED LONG) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED LONG) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
        CASE 1 '                             image is 8 bit image (256 colors)
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB(1, 1, 1)
            Empty~& = _RGBA(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED _BYTE) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED _BYTE) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
    END SELECT
END SUB


   

Find my programs here in Dav's QB64 Corner
Reply
#2
Still working on this.  Added a couple things, fixed a few things.  Used the Text SUB by @bplus to make a menu.  Nice SUB bplus - it's faster than my PPRINT SUB.  I need to work out the _DISPLAY stuff more, and redo the smooth SUB, it was a quick throw-in.

- Dav

Code: (Select All)
'============
'QuadDraw.bas v1.4
'============
'An odd little drawing program.
'Draws/paints in several areas of the screen at same time.
'Coded by Dav for QB64 MAY/2022

'NEW FOR v1.4:  Now shows menu of settings on right side.
'               (Uses Text SUB by bplus for the menu text)
'               Added 'Smooth' SUB (Press S to smooth screen)
'               Fixed serious PAINT bug when brushsize is 1.

'CREDITS: SPAINT SUB was made by Petr.  Thanks Petr!
'         text SUB was made by bplus.  thanks bplus!
'         (bplus helped me out how to draw lines without gaps too)

'----------
'HOW TO USE:
'----------
'Use the mouse to draw/color on screen.
'Left click = draws on screen.
'Right click = fills areas with color.
'Use the +/- keys to change brush size (1 to 50 allowed)
'Press 1,2,3 or 4 to set how many areas to draw in, default is 4.
'Press S to smooth the image.
'Press U to undo last change.
'Space = clears screen and starts over.
'ESC = Ends program

'Current drawing settings are shown in title bar

DIM SHARED quads, brushsize

SCREEN _NEWIMAGE(1000, 600, 32) '_DESKTOPWIDTH * .75, _DESKTOPHEIGHT * .85, 32)

centerx = (_WIDTH - 200) / 2
centery = _HEIGHT / 2

wht& = _RGB(255, 255, 255) 'used often, so variable it
blk& = _RGB(0, 0, 0)
brushsize = 3 'size of drawing circle (brush)
quads = 4 'start with 4 drawing sections

CLS , wht& 'start with white screen

_DELAY .25

undo& = _COPYIMAGE(_DISPLAY)

'====
main:
'====

_TITLE "QuadDraw - Quads:" + STR$(quads) + "  BrushSize:" + STR$(brushsize)

DrawMenu

DO

    WHILE _MOUSEINPUT: WEND

    mx = _MOUSEX: my = _MOUSEY

    IF mx <= (_WIDTH - 200 - brushsize / 2) THEN

        IF _MOUSEBUTTON(1) THEN

            IF stilldown = 0 THEN
                _FREEIMAGE undo&
                undo& = _COPYIMAGE(_DISPLAY)
            END IF

            IF stilldown = 1 THEN
                stepx = lastmx - mx
                stepy = lastmy - my
                length = INT((stepx ^ 2 + stepy ^ 2) ^ .5)
                dx = stepx / length
                dy = stepy / length
                FOR i = 0 TO length
                    FOR d = 1 TO brushsize
                        newx = mx + dx * i: newy = my + dy * i
                        CIRCLE (newx, newy), d, blk&
                        IF brushsize > 1 THEN PAINT (newx, newy), blk&, blk&
                        IF quads > 1 THEN
                            CIRCLE (centerx - newx + centerx, centery - newy + centery), d, blk&
                            IF brushsize > 1 THEN PAINT (centerx - newx + centerx, centery - newy + centery), blk&, blk&
                        END IF
                        IF quads > 2 THEN
                            CIRCLE (newx, centery - newy + centery), d, blk&
                            IF brushsize > 1 THEN PAINT (newx, centery - newy + centery), blk&, blk&
                        END IF
                        IF quads > 3 THEN
                            CIRCLE (centerx - newx + centerx, newy), d, blk&
                            IF brushsize > 1 THEN PAINT (centerx - newx + centerx, newy), blk&, blk&
                        END IF
                    NEXT
                NEXT
            ELSE
                FOR d = 1 TO brushsize STEP .2
                    CIRCLE (mx, my), d, blk&&
                NEXT
            END IF
            lastmx = mx: lastmy = my
            stilldown = 1
            DrawMenu: _DISPLAY
        ELSE
            stilldown = 0
        END IF

        'if right click, fill sections with random color
        IF _MOUSEBUTTON(2) THEN

            _FREEIMAGE undo&
            undo& = _COPYIMAGE(_DISPLAY)

            r = RND * 255: g = RND * 255: b = RND * 255

            _DISPLAY

            SPAINT mx, my, _RGB(r, g, b) ', blk&
            IF quads > 1 THEN
                SPAINT centerx - mx + centerx, centery - my + centery, _RGB(r, g, b) ', blk&
            END IF
            IF quads > 2 THEN
                SPAINT mx, centery - my + centery, _RGB(r, g, b) ', blk&
            END IF
            IF quads > 3 THEN
                SPAINT centerx - mx + centerx, my, _RGB(r, g, b) ', blk&
            END IF

            DrawMenu

            _AUTODISPLAY

            WHILE _MOUSEBUTTON(2) <> 0: N = _MOUSEINPUT: WEND
        END IF

    END IF

    'get keyboard input
    key$ = UCASE$(INKEY$)
    IF key$ <> "" THEN
        SELECT CASE key$
            CASE CHR$(32): CLS , wht&: DrawMenu 'scpace clears screen again
            CASE "1": quads = 1
            CASE "2": quads = 2
            CASE "3": quads = 3
            CASE "4": quads = 4
            CASE "+"
                brushsize = brushsize + 1: IF brushsize > 50 THEN brushsize = 50
            CASE "-"
                brushsize = brushsize - 1: IF brushsize < 1 THEN brushsize = 1
            CASE "U": _PUTIMAGE (0, 0), undo&
            CASE "S": Smooth
            CASE CHR$(27): END
        END SELECT
        DO UNTIL INKEY$ = "": LOOP
        _DISPLAY
        GOTO main
    END IF

    _AUTODISPLAY

LOOP

END

SUB SPAINT (x AS INTEGER, y AS INTEGER, clr~&) 'Color everything in the X, Y position regardless of the border color.
    'SUB by Petr
    DIM m AS _MEM, m2 AS _MEM

    m = _MEMIMAGE(_DEST)
    W = _WIDTH(_DEST)
    H = _HEIGHT(_DEST)
    P = _PIXELSIZE(_DEST)

    SELECT CASE P
        CASE 4 '                             image is 32 bit image
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB32(1, 1, 1)
            Empty~& = _RGBA32(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED LONG) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED LONG) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
        CASE 1 '                             image is 8 bit image (256 colors)
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB(1, 1, 1)
            Empty~& = _RGBA(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED _BYTE) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED _BYTE) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
    END SELECT
END SUB


SUB Text (x, y, textHeight, K AS _UNSIGNED LONG, txt$)
    'Text SUB by bplus.
    DIM fg AS _UNSIGNED LONG, cur&, I&, multi, xlen
    fg = _DEFAULTCOLOR
    cur& = _DEST
    I& = _NEWIMAGE(8 * LEN(txt$), 16, 32)
    _DEST I&
    COLOR K, _RGBA32(0, 0, 0, 0)
    _PRINTSTRING (0, 0), txt$
    multi = textHeight / 16
    xlen = LEN(txt$) * 8 * multi
    _PUTIMAGE (x, y)-STEP(xlen, textHeight), I&, cur&
    COLOR fg
    _FREEIMAGE I&
END SUB

SUB Smooth
    FOR x = 1 TO _WIDTH - 202
        FOR y = 1 TO _HEIGHT - 1
            p1~& = POINT(x, y)
            p2~& = POINT(x + 1, y)
            p3~& = POINT(x, y + 1)
            p4~& = POINT(x + 1, y + 1)
            p5~& = POINT(x - 1, y)
            p6~& = POINT(x, y - 1)
            p7~& = POINT(x - 1, y - 1)
            p8~& = POINT(x - 1, y + 1)
            p9~& = POINT(x + 1, y - 1)
            r = _RED32(p1~&) + _RED32(p2~&) + _RED32(p3~&) + _RED32(p4~&) + _RED32(p5~&) + _RED32(p6~&) + _RED32(p7~&) + _RED32(p8~&) + _RED32(p9~&)
            g = _GREEN32(p1~&) + _GREEN32(p2~&) + _GREEN32(p3~&) + _GREEN32(p4~&) + _GREEN32(p5~&) + _GREEN32(p6~&) + _GREEN32(p7~&) + _GREEN32(p8~&) + _GREEN32(p9~&)
            b = _BLUE32(p1~&) + _BLUE32(p2~&) + _BLUE32(p3~&) + _BLUE32(p4~&) + _BLUE32(p5~&) + _BLUE32(p6~&) + _BLUE32(p7~&) + _BLUE32(p8~&) + _BLUE32(p9~&)
            PSET (x, y), _RGB(r / 9, g / 9, b / 9)
        NEXT
    NEXT
END SUB

SUB DrawMenu
    LINE (_WIDTH - 200, 0)-(_WIDTH, _HEIGHT), _RGB(96, 96, 96), BF
    LINE (_WIDTH - 200, 0)-(_WIDTH - 195, _HEIGHT), _RGB(164, 164, 164), BF
    '_PUTIMAGE (_WIDTH - 190, 10), menu&
    Text _WIDTH - 177, 12, 38, _RGB(0, 0, 0), "QuadDraw"
    Text _WIDTH - 175, 10, 38, _RGB(255, 255, 100), "QuadDraw"
    Text _WIDTH - 152, 47, 16, _RGB(0, 0, 0), "By Dav - v1.4"
    Text _WIDTH - 150, 45, 16, _RGB(255, 255, 100), "By Dav - v1.4"
    Text _WIDTH - 177, 102, 22, _RGB(0, 0, 0), "NUMBER OF QUADS"
    Text _WIDTH - 175, 100, 22, _RGB(255, 255, 255), "NUMBER OF QUADS"
    Text _WIDTH - 177, 132, 42, _RGB(0, 0, 0), "1 2 3 4"
    Text _WIDTH - 175, 130, 42, _RGB(255, 255, 255), "1 2 3 4"
    IF quads = 1 THEN
        LINE (_WIDTH - 183, 125)-(_WIDTH - 148, 170), _RGBA(255, 255, 255, 100), BF
        LINE (_WIDTH - 183, 125)-(_WIDTH - 148, 170), _RGB(255, 255, 255), B
    END IF
    IF quads = 2 THEN
        LINE (_WIDTH - 145, 125)-(_WIDTH - 105, 170), _RGBA(255, 255, 255, 100), BF
        LINE (_WIDTH - 145, 125)-(_WIDTH - 105, 170), _RGB(255, 255, 255), B
    END IF
    IF quads = 3 THEN
        LINE (_WIDTH - 103, 125)-(_WIDTH - 62, 170), _RGBA(255, 255, 255, 100), BF
        LINE (_WIDTH - 103, 125)-(_WIDTH - 62, 170), _RGB(255, 255, 255), B
    END IF
    IF quads = 4 THEN
        LINE (_WIDTH - 60, 125)-(_WIDTH - 15, 170), _RGBA(255, 255, 255, 100), BF
        LINE (_WIDTH - 60, 125)-(_WIDTH - 15, 170), _RGB(255, 255, 255), B
    END IF

    Text _WIDTH - 179, 202, 22, _RGB(0, 0, 0), "BRUSH SIZE =" + STR$(brushsize)
    Text _WIDTH - 177, 200, 22, _RGB(255, 255, 255), "BRUSH SIZE =" + STR$(brushsize)
    Text _WIDTH - 179, 228, 22, _RGB(0, 0, 0), "(+/- to change)"
    Text _WIDTH - 177, 226, 22, _RGB(255, 255, 255), "(+/- to change)"

    LINE (_WIDTH - 160, 260)-(_WIDTH - 40, 380), _RGB(164, 164, 164), BF
    LINE (_WIDTH - 160, 260)-(_WIDTH - 40, 380), _RGB(255, 255, 255), B
    CIRCLE (_WIDTH - 100, 320), brushsize, _RGB(0, 0, 0)
    IF brushsize > 1 THEN PAINT (_WIDTH - 100, 320), _RGB(0, 0, 0)

    Text _WIDTH - 179, 412, 22, _RGB(0, 0, 0), "PRESS SPACE TO"
    Text _WIDTH - 177, 410, 22, _RGB(255, 255, 255), "PRESS SPACE TO"
    Text _WIDTH - 179, 434, 22, _RGB(0, 0, 0), "CLEAR SCREEN."
    Text _WIDTH - 177, 432, 22, _RGB(255, 255, 255), "CLEAR SCREEN."

    Text _WIDTH - 179, 482, 22, _RGB(0, 0, 0), "S = SMOOTH IT"
    Text _WIDTH - 177, 480, 22, _RGB(255, 255, 255), "S = SMOOTH IT"

    Text _WIDTH - 179, 522, 22, _RGB(0, 0, 0), "U = WILL UNDO"
    Text _WIDTH - 177, 520, 22, _RGB(255, 255, 255), "U = WILL UNDO"
    Text _WIDTH - 179, 544, 22, _RGB(0, 0, 0), "    LAST CHANGE"
    Text _WIDTH - 177, 542, 22, _RGB(255, 255, 255), "    LAST CHANGE"

END SUB

   

Find my programs here in Dav's QB64 Corner
Reply
#3
Nice ! Just missing the screen recording option (jpeg or bmp...)
Why not yes ?
Reply
#4
(05-30-2022, 11:09 AM)euklides Wrote: Nice ! Just missing the screen recording option (jpeg or bmp...)

Thanks.  Okay, I adapted a quick BMP saving SUB that was in the wiki.  Press S to save screen as QUADDRAW.BMP in current directory.  I fixed some paint/drawing issues, added a color picker, and a better looking menu.  I will add later a better file saving method so you can specify the name of a saved file.  When you select a color, then random fill color is turned off.  You can turn that back on again by pressing R.  

I'm just out of coding time for a while - so here's the latest version as it is... 

- Dav

Code: (Select All)
'============
'QuadDraw.bas v1.5
'============
'An odd little drawing program.
'Draws/paints in several areas of the screen at same time.
'Coded by Dav for QB64 MAY/2022

'NEW FOR v1.5:
'               Added ColorPicker for Fill color choice.
'               Added R for random fill color toggle on/off.
'               (when picking a color, random is turned off)
'               (turn random color on again by pressing R)
'               New menu now using built-in image one.
'               Fixed a pesky drawing/fill bug, finally.
'               Smooth SUB tweaked, change it to PRESS A
'               Now can save image as QUADDRAW.BMP file.
'               PRESS S to save image in current directory.

'CREDITS: SPAINT SUB was made by Petr.  Thanks Petr!
'         text SUB was made by bplus.  thanks bplus!
'         (bplus helped me out how to draw lines without gaps too)

'----------
'HOW TO USE:
'----------

'Left click on mouse and hold to draw on the screen.
'Press 1,2,3 or 4 to set how many areas to draw in, default is 4.
'Use the +/- keys to change brush size (1 to 50 allowed)

'Right click to fill/paint the areas with color.
'Default fill color is picked randomly, but you can select one.
'Press C to select a fill color (doing so turns random fill color off)

'Press R to toggle random fill color on/off (default is a random color)

'Press A to smooth the screen using AntiAliasing.

'Press S to save current image as QUADDRAW.BMP in current dir.

'Press U to undo last change made to image.

'Space = clears screen and starts over.

'ESC = Ends program

'================================================================

DIM SHARED quads, brushsize, randfill, menu&

menu& = BASIMAGE1&

SCREEN _NEWIMAGE(1000, 600, 32) '_DESKTOPWIDTH * .75, _DESKTOPHEIGHT * .85, 32)

centerx = (_WIDTH - 200) / 2
centery = _HEIGHT / 2

wht& = _RGB(255, 255, 255) 'used often, so variable it
blk& = _RGB(0, 0, 0)
fill& = _RGB(RND * 255, RND * 255, RND * 255)
brushsize = 3 'size of drawing circle (brush)
quads = 4 'start with 4 drawing sections
randfill = 1 'default is use random fill color turned on

CLS , wht& 'start with white screen

_DELAY .25

undo& = _COPYIMAGE(_DISPLAY)

'====
main:
'====

_TITLE "QuadDraw - Quads:" + STR$(quads) + "  BrushSize:" + STR$(brushsize)

DrawMenu

DO

    WHILE _MOUSEINPUT: WEND

    mx = _MOUSEX: my = _MOUSEY

    IF mx <= (_WIDTH - 200 - brushsize / 2) THEN

        IF _MOUSEBUTTON(1) THEN

            IF stilldown = 0 THEN
                _FREEIMAGE undo&
                undo& = _COPYIMAGE(_DISPLAY)
            END IF

            IF stilldown = 1 THEN
                stepx = lastmx - mx
                stepy = lastmy - my
                length = INT((stepx ^ 2 + stepy ^ 2) ^ .5)
                dx = stepx / length
                dy = stepy / length
                FOR i = 0 TO length
                    FOR d = 1 TO brushsize
                        newx = mx + dx * i: newy = my + dy * i
                        CIRCLE (newx, newy), d, blk&
                        IF brushsize > 1 THEN PAINT (newx, newy), blk&, blk&
                        IF quads > 1 THEN
                            CIRCLE (centerx - newx + centerx, centery - newy + centery), d, blk&
                            IF brushsize > 1 THEN PAINT (centerx - newx + centerx, centery - newy + centery), blk&, blk&
                        END IF
                        IF quads > 2 THEN
                            CIRCLE (newx, centery - newy + centery), d, blk&
                            IF brushsize > 1 THEN PAINT (newx, centery - newy + centery), blk&, blk&
                        END IF
                        IF quads > 3 THEN
                            CIRCLE (centerx - newx + centerx, newy), d, blk&
                            IF brushsize > 1 THEN PAINT (centerx - newx + centerx, newy), blk&, blk&
                        END IF
                    NEXT
                NEXT
            ELSE
                FOR d = 0 TO brushsize STEP .2
                    CIRCLE (mx, my), d, blk&
                    IF quads > 1 THEN
                        CIRCLE (centerx - mx + centerx, centery - my + centery), d, blk&
                    END IF
                    IF quads > 2 THEN
                        CIRCLE (mx, centery - my + centery), d, blk&
                    END IF
                    IF quads > 3 THEN
                        CIRCLE (centerx - mx + centerx, my), d, blk&
                    END IF
                NEXT
            END IF
            lastmx = mx: lastmy = my
            stilldown = 1
            DrawMenu: _DISPLAY
        ELSE
            stilldown = 0
        END IF

        'if right click, fill sections with random color
        IF _MOUSEBUTTON(2) THEN

            _FREEIMAGE undo&
            undo& = _COPYIMAGE(_DISPLAY)

            IF randfill = 1 THEN
                r = RND * 255: g = RND * 255: b = RND * 255
                fill& = _RGB(r, g, b)
            END IF

            _DISPLAY

            SPAINT mx, my, fill& ', blk&
            IF quads > 1 THEN
                SPAINT centerx - mx + centerx, centery - my + centery, fill& ', blk&
            END IF
            IF quads > 2 THEN
                SPAINT mx, centery - my + centery, fill& ', blk&
            END IF
            IF quads > 3 THEN
                SPAINT centerx - mx + centerx, my, fill& ', blk&
            END IF

            DrawMenu

            _AUTODISPLAY

            WHILE _MOUSEBUTTON(2) <> 0: N = _MOUSEINPUT: WEND
        END IF

    END IF

    'get keyboard input
    key$ = UCASE$(INKEY$)
    IF key$ <> "" THEN
        SELECT CASE key$
            CASE CHR$(32): CLS , wht&: DrawMenu 'scpace clears screen again
            CASE "1": quads = 1
            CASE "2": quads = 2
            CASE "3": quads = 3
            CASE "4": quads = 4
            CASE "+"
                brushsize = brushsize + 1: IF brushsize > 50 THEN brushsize = 50
            CASE "-"
                brushsize = brushsize - 1: IF brushsize < 1 THEN brushsize = 1
            CASE "U": _PUTIMAGE (0, 0), undo&
            CASE "A": Smooth
            CASE "S": SaveAsBMP "quaddraw.bmp"
                back& = _COPYIMAGE(_DISPLAY)
                LINE (275, 200)-(550, 250), _RGB(96, 96, 96), BF
                LINE (275, 200)-(550, 250), _RGB(255, 255, 255), B
                Text 312, 217, 22, _RGB(0, 0, 0), "QUADDRAW.BMP SAVED!"
                Text 310, 215, 22, _RGB(255, 255, 255), "QUADDRAW.BMP SAVED!"
                _DISPLAY
                _DELAY 2
                _PUTIMAGE (0, 0), back&: _DISPLAY
                _FREEIMAGE back&
            CASE "C"
                new& = ColorPicker&(200, 150)
                IF new& <> 0 THEN
                    randfill = 0
                    fill& = new&
                END IF
            CASE "R"
                DO UNTIL INKEY$ = "": LOOP
                SELECT CASE randfill
                    CASE IS = 1: randfill = 0
                    CASE IS = 0: randfill = 1
                END SELECT
            CASE CHR$(27): END
        END SELECT
        DO UNTIL INKEY$ = "": LOOP
        _DISPLAY
        GOTO main
    END IF

    _AUTODISPLAY

LOOP

END

SUB SPAINT (x AS INTEGER, y AS INTEGER, clr~&) 'Color everything in the X, Y position regardless of the border color.
    'SUB by Petr
    DIM m AS _MEM, m2 AS _MEM

    m = _MEMIMAGE(_DEST)
    W = _WIDTH(_DEST)
    H = _HEIGHT(_DEST)
    P = _PIXELSIZE(_DEST)

    SELECT CASE P
        CASE 4 '                             image is 32 bit image
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB32(1, 1, 1)
            Empty~& = _RGBA32(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED LONG) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 4
                a& = a& + 4
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED LONG) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
        CASE 1 '                             image is 8 bit image (256 colors)
            Virtual = _NEWIMAGE(W, H, 32)
            m2 = _MEMIMAGE(Virtual)
            Back~& = POINT(x, y)
            Back2~& = _RGB(1, 1, 1)
            Empty~& = _RGBA(0, 0, 0, 0)
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m, m.OFFSET + a&, _UNSIGNED _BYTE) = Back~& THEN _MEMPUT m2, m2.OFFSET + a&, Back~& ELSE _MEMPUT m2, m2.OFFSET + a&, Back2~&
            LOOP
            d = _DEST
            _DEST Virtual
            PAINT (x, y), clr~&, Back2~&
            _DEST d
            a& = 0
            DO UNTIL a& = m.SIZE - 1
                a& = a& + 1
                IF _MEMGET(m2, m2.OFFSET + a&, _UNSIGNED _BYTE) <> clr~& THEN _MEMPUT m2, m2.OFFSET + a&, Empty~&
            LOOP
            _CLEARCOLOR Back2~&, Virtual
            _PUTIMAGE (0, 0), Virtual
            _MEMFREE m
            _MEMFREE m2
            _FREEIMAGE Virtual
    END SELECT
END SUB


SUB Text (x, y, textHeight, K AS _UNSIGNED LONG, txt$)
    'Text SUB by bplus.
    DIM fg AS _UNSIGNED LONG, cur&, I&, multi, xlen
    fg = _DEFAULTCOLOR
    cur& = _DEST
    I& = _NEWIMAGE(8 * LEN(txt$), 16, 32)
    _DEST I&
    COLOR K, _RGBA32(0, 0, 0, 0)
    _PRINTSTRING (0, 0), txt$
    multi = textHeight / 16
    xlen = LEN(txt$) * 8 * multi
    _PUTIMAGE (x, y)-STEP(xlen, textHeight), I&, cur&
    COLOR fg
    _FREEIMAGE I&
END SUB

FUNCTION ColorPicker& (xpos, ypos)
    'ColorPicker& Function by Dav, SEP/2020. FREE TO USE FOR ALL
    'Function Returns color picked by user if one selected.
    'If no color selected before Closing, function returns 0
    'Click CLOSE to close the ColorPicker image.
    'ESC key cancels selection and closes picker too.
    'The xpos/ypos is x/y point on the screen to place colorpicker

    '=== Save users display status
    DisplayStatus% = _AUTODISPLAY

    '=== copy background screen using _mem (thanks Steve!)
    '=== Used this method because_COPYIMAGE(_DISPLAY) didnt always work
    DIM scr1 AS _MEM, scr2 AS _MEM
    scr1 = _MEMIMAGE(0): scr2 = _MEMNEW(scr1.SIZE)
    _MEMCOPY scr1, scr1.OFFSET, scr1.SIZE TO scr2, scr2.OFFSET

    'Create Colorpicker image
    v& = _NEWIMAGE(463, 239, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = "" '...COLORPICKER.PNG encoded by BASIMAGE...
    A$ = A$ + "haIkMo7KDGOh77_oaBfFFfOhBL9c5gGWaX9BRK62K46AkHnS9I=`09EP<4V="
    A$ = A$ + "e25F]0eB;]jK;#YFXUEJQJGM573`644fjGM:62H66L42I^89^HF<co`T]oHo"
    A$ = A$ + "anW]TUUk;O2BnLONnmjek3L7m>li;cS4;]LohSGjC_[gM=C6WciL>WciL>Wc"
    A$ = A$ + "iL>WciL>WciL>Wci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cf9KUiX?>E]c9kcIkdfI9^MNmjkSHkd"
    A$ = A$ + "fY]cTcfY]CKWEV]CWciL>WciL>WciL>WciL>WciL>W;OkoC[%%L2"
    btemp$ = "" 'decode string data to image data
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$, m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m

    'Put colorpicker image on screen at xpos/ypos
    _PUTIMAGE (xpos, ypos), v&: _DISPLAY: _FREEIMAGE v&

    '====================================

    '=== Now get users color selection...

    '=== no selection made yet
    selected = 0

    '=== main loop
    DO
        '=== Get mouse input
        WHILE _MOUSEINPUT
            '=== Get mouse x/y
            mx = _MOUSEX: my = _MOUSEY
            '=== Only poll this area
            IF mx < (xpos + 473) AND my < (ypos + 243) THEN
                '=== if click button in area
                IF _MOUSEBUTTON(1) THEN
                    '=== if clicked in CLOSE box area
                    IF mx > (xpos + 352) AND mx < (xpos + 457) AND my > (ypos + 5) AND my < (ypos + 72) THEN
                        GOTO donepicking
                    END IF
                    '=== made a color selection
                    selected = 1
                    '=== Get color where mouse pointer is
                    clr& = POINT(mx, my)
                    '=== Make Red Green Blue color values
                    red = _RED32(clr&): grn = _GREEN32(clr&): blu = _BLUE32(clr&)
                    '=== show color selected in box
                    LINE ((xpos + 246), (ypos + 7))-((xpos + 347), (ypos + 70)), _RGB(red, grn, blu), BF
                    '=== Update gradient strip with color...
                    '=== ...only if mouse not in gradient strip area
                    IF mx <= (xpos + 246) OR mx >= (xpos + 457) OR my <= (ypos + 77) OR my >= (ypos + 107) THEN
                        c = 0
                        FOR x = (xpos + 453) TO (xpos + 242) STEP -4
                            LINE (x, (ypos + 77))-(x + 4, (ypos + 107)), _RGB(red + c, grn + c, blu + c), BF
                            c = c + 4
                        NEXT
                    END IF
                END IF
                '=== update screen
                _DISPLAY
            END IF
        WEND

        '=== ESC key cancels picking and closes
        IF INKEY$ = CHR$(27) THEN
            selected = 0: GOTO donepicking
        END IF

        '=== don't be a cpu pig
        _LIMIT 60

    LOOP 'UNTIL INKEY$ <> ""

    donepicking:

    '=== wait for mouse button UP to continue
    DO: mi = _MOUSEINPUT: LOOP UNTIL _MOUSEBUTTON(1) = 0

    '=== if user selected color, say so
    IF selected = 1 THEN
        ColorPicker& = clr&
    ELSE
        ColorPicker& = 0
    END IF

    '====================================

    'Restore background as it was
    _MEMCOPY scr2, scr2.OFFSET, scr2.SIZE TO scr1, scr1.OFFSET
    _MEMFREE scr1: _MEMFREE scr2

    'Restore display status as it was
    IF DisplayStatus% = -1 THEN _AUTODISPLAY

END FUNCTION

FUNCTION BASIMAGE1& 'quadmenu3.png
    v& = _NEWIMAGE(185, 593, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = ""
    A$ = A$ + "haIkm5T]\LZ[\^YKjVN:h1QW4^YkNKj1PknKhQSWIN#Ln;MO_hIi`Q4R<cZb"
    A$ = A$ + "ZZM`J5[cIW59841TP04oWocoikn?66666666666666666g:nmOogoF6g]lHH"
    A$ = A$ + "LFlKof_m]oh?nS_mokKO[5oiOnWO;RkM;_?;4jTEHWhV1joh[Tnl>[7Ga]EL"
    A$ = A$ + "mkF^O6HR^HWhfQLk5S[37QO[ZOoDa4M`?mCodo5WUS3hne_>4jb[X_WOmGoe"
    A$ = A$ + "?fjT9jP_kkn^o;^:>NP?IMjc4ah=^R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 + "hoCnhDN[ihoclhAbage61GU]aWFn=7oa`aW\V\O:LlM7o>\?dI]Kh>LlMFSL"
    A$ = A$ + "caWaaW^Vg_ZLlM\ae^f4kZ\=n>c7IWib]S]LWH[TYLL\6OG977c_oZgK]kPW"
    A$ = A$ + "17OjiJiXLlYkC[\lX\?dSRS?5hk;C?[KCeAk<WcYW?dYLl0C]]lSPSOT_=N4"
    A$ = A$ + ">ndjR<7O7>kdnchliZlk6GajZT]WidiX?5XNkZF7SMihkF_LUYIDo4Yi>WO#"
    A$ = A$ + "VKl8>GfkbagI\IhLYLULl0WI]aSg?_?P>kI0_[Nk:B_<7o^>cbC1>?SkL>`?"
    A$ = A$ + "Rmag]<^Kj^CO:GY]a?KoiQNTgSKIkINeko\717o^lm4C#8K8=Wj??ZhhGen;"
    A$ = A$ + "i<LlYnJ3Do4L[[VS78dUk\oOckCchmieMMBJ\KmfZh_Z]EVS?Yn?nmWiL>3i"
    A$ = A$ + "3c]9o=kc`aWdWc^ciL:7?g_lThOUf6_SWWkCNWj7Ej1mMfGm3kA68:;M#]oc"
    A$ = A$ + "P=UDY9>G0E8omo\<RinW_?1bjREb9Z7SnO1?MekX:W<#I5Y;liNCeEIPmKO^"
    A$ = A$ + "LR_7?Y^PihC:[#O7Y?l?OCd3?B>>ZcgIN20Ioj0#dg>:W:0NIe_[VoaTd\Rc"
    A$ = A$ + "TWK<Gogm>An]:=ceoI>aA0doEm1=EG]kk?Y^PCc9Ue\nNBioZ\=n:\khE[d1"
    A$ = A$ + "P3a]gim`O7Dko\Zd<RkTdTC_hmDY7hJkTVC;GCT;^oWSX[hdh<e57AV>R^iI"
    A$ = A$ + "`a3<e_4^RSKHl:3\?`VRkFN=<>2`ImfLL333333333333333333333333333"
    A$ = A$ + "33333333333333333333333333SN4nB0hgOb0g]Wg]la#9[0`?_HL_8Z7n[o"
    A$ = A$ + "j_n67NfbA`O3NaZ`[2g9T3UNS3ALRhNgeaC2AkekF_Ne8:CEeC?KII2O9cK^"
    A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^C>odhh`W[5o;Of4bS;kI`EZ>S4[0h=g5W1bLl_:OGGl"
    A$ = A$ + "l<g6mQo<mS0<hmMPBOnY`aceCZiVl:L69VRk\OA5?^2aHL_CnM6MbiW677nQ"
    A$ = A$ + "W:l<i:W1g]N4ke3ellN5g38MjbGUfQ666666666666666666666666666666"
    A$ = A$ + "666666666666666666Oj8>STicF8N>OV3SWQkY\li#TOoZh^:ma_YB_Lne9k"
    A$ = A$ + "ZhfmkaiCMUn9OWZ3o]CT_ihDU7Zh2Pk5bLjbn0V:MKU>]CO\S>S1kCVjRk[8"
    A$ = A$ + "hcL_bo_7oODFc1DFcQZhVo]XnE5DbS:=0g\;^XNMEJEa1IM07beaCSGVWEm>"
    A$ = A$ + "MU?XohgYZ^TO_Yjg\>IUO>j^i_7QS7bMLV2cU=l<Ek1fo2G5G4`I6^jgFi_R"
    A$ = A$ + "cjfEgmO[lQf8]DW9a9LQ9lPliaOBlQ\gEg`Q9gILa_7WSdEU;T?X]hZ`k`ii"
    A$ = A$ + "DeGALN[cj;hGbhnOAm7[ODa51h?5D1L^iidS_Sa`M25G7ToVOl>:oI6gn5gW"
    A$ = A$ + ":li4Vi;ZfVAN4Pi\i_o3O<:BOF_0o5dTb7d]L0WAn\<cb4^C:D]KDgQKQ<=A"
    A$ = A$ + "7PfGg=?N7>>Tk757_[Ol:>NEmZjK8[lIO<G0?SmWI<7Am=6h;9Da]b7=XhHk"
    A$ = A$ + "FnDa=0o]GU<]Cnc]aDj0T^_bmW[hhHN9\Nh<LLXoQ?d9o\\NM7>NEL3NGU?k"
    A$ = A$ + "[RScge[CihZdSm5P1>27O7M1cail1bj>OK#e6;:;AMKnn#oEg?[XhhhKn\Nh"
    A$ = A$ + "<LLTNAnQj25GCUNEiAELS_mRi]aU=eHEDn0Yc`aQoCAIgV797WU]LI8hfEe;"
    A$ = A$ + "EYYbgASiTbO[jMSSSb2[7>377mOTi3LN[ZGEjG<6g^hRi]E6Qogd[bGfM6>N"
    A$ = A$ + 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?1kgaa5li:KUU]A03TV0ZmbdAbo>kSWgO"
    A$ = A$ + "0LN0N8;7LkWZi6FUfVSOo0[oB5F5G`mZN7lkP[PnC[TULoQao?NfIco:IA=_"
    A$ = A$ + "^>MA5FY3cU13333333333333333333333333333333333333333333333333"
    A$ = A$ + "33333333333333333333S07i>f6?;O_d`nNb^kZ6F6jRk:IROFnN;IJnO6Te"
    A$ = A$ + "3kho=[T9EiYZL`gMiMYCl\9gijIXBOU<`LY>NaMPM_S]klaZIMLELDgSC]>m"
    A$ = A$ + "bDn[NVjNfIglo<8WokLO1Z:;ZkJS>oV:hCLICMOk>m>GWK7^:PjlEgoI_BLL"
    A$ = A$ + "LOU`1hGeF5P?;[CWPdJ7>NU<=iNEIEnODTiBAm8^;=WhK2EU5^^0nl^Z0lAZ"
    A$ = A$ + "Lj`YOT>ZkaXL0gM0kba3I#MGH`Q#>OUhhEn\HFO[dW`70b1l]=emhDnKWi#n"
    A$ = A$ + "ni[BVDgW3ZhfUoZn_V<^V\^3nloYnOCEIQkCFiCYcj4h7OcQ`7h6mc`Y3[WZ"
    A$ = A$ + "^cec]mag9DLm\<`mm5_;;gh^JjMTS[NFWOmFiKJ1Dn_klkXBcYLl9iO^=G4F"
    A$ = A$ + "m=fLN3OmLl_Cdk\laLR8>Mn=m<b]=hk#?T>\NZjI:iGeW5kCMcQ^k]Sk`okN"
    A$ = A$ + "fklNLoHbnlk:M2nN^Z=MemDLTVakXBcMihMi?caG=^VLKQ\OHn8LLN\4Eg[Y"
    A$ = A$ + "Xn1j4hcccj\\>1j3F?EMW[[l;eZaXVeWkNW1o:ca3M27`M`:kO]i0dSMc;C="
    A$ = A$ + "fj\NQCCN>G8O>Jn[hhEmiWiTikY]YmCYdSioOEOTifMH<^II9[3cYSJlh`V:"
    A$ = A$ + "\O?ORlVSkTi4eY;OUhhlg5ig;k_\[2MSaMG>^:DaakboYg1cIK?TUEL?]5m]"
    A$ = A$ + ">E_gU?a_ga=EbSZNQKk=i>G_Z=:o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$ + "kBWG=<US[j77mAUkWWAfV3kFgN5mOm8\c8:7COo\ME>27oEZOl:kZ`fLkE2W"
    A$ = A$ + "a^:0GahaOflfcJ;mS<FWSlm\G=kZDaaOUWc9GVEg;\i_iZNohkd`n;E8go5g"
    A$ = A$ + "^B]nlXNIWjFnnIFU^An_KLEgmfCFCVLPgk9kZ7fANkVWN47emV^J]?oThh[6"
    A$ = A$ + "GMnNklIUW#7_KoUCCgMR;c_ZRk^LlMd3k8_[hhEf721Lgao9aakf_?IKHMU["
    A$ = A$ + "GKeNMT]ij>[QM8OCCgho_CL[h5ihfaa[6gbS#NIk>U38>EU7HWT?=>>06C10"
    A$ = A$ + "O_0o8\?D>?SdWcc8>hkbALSO_JMBhkQi^dU_;GW4GlkiiCWSKloQ=ohaZYTa"
    A$ = A$ + "Md3k8_\>;SLLHk30I<g^2fC:onAlRWQaXn>aa3ko`UCeL6_BXJ;1nBgm[]JM"
    A$ = A$ + "BblWYYk^aUU3ELIiZB6?Z<LDM6g>X;>ln<Emn\]6^Knk^l^Zi;nX#NN[aoW]"
    A$ = A$ + "gZb^TH=IbHgdm8a=NNGLEbEW<nXTgYb`TjKek_Cib```````````````````"
    A$ = A$ + "hE37eg>M6dUO:OBCEl[R3B3fOAMdbk4O8FEjfE6DUEFVIi[b7HeUf[l[HOjX"
    A$ = A$ + "klIQm2aEWWCmK>POE5bW3HN?GPjmLHJiUi7ClQHEY;nMEJ<i<NbU;ngAIUCo"
    A$ = A$ + "LJgiGan:PEeiEe5?B>>>G0[T?\nL<77kA9eNRVg?ZZ#^O^Y]7[Tc^mL;n]^c"
    A$ = A$ + "=1WGZmS[J_aVCKeI40[=jMco^3>NDnEkEi[lLN`e7Anae]AnQcDJ>TOG\_#R"
    A$ = A$ + "e`V3`oWT3Zm6XZl61L6Lihbn#\#NDiEF6EnRW8Pm:B77WmeFEk_lZch#57oZ"
    A$ = A$ + "g7Y_bHbi0:O^6O4LLEo[H?mYnf<GoZjK6iEnIELlZm#:cmkRKeg72IXZOl9L"
    A$ = A$ + "LNoMI>nSUScjTEn8[:oJjD>>Ggan?XLK?>PakT3kba?CLAI<N787ZbmD>>>C"
    A$ = A$ + "XEWS=cagSScmOQc52[CnGEfRPJ\lC6[2fkX\O>8;_`7=Ee?idaZl8hhXl0o#"
    A$ = A$ + "BnI8<QS3o00f_lE]1>37?[SODfBkERSc1<Nc^na[\e5VK3ONdWhSQagVI>^Z"
    A$ = A$ + "_i8m[TM>^?;>N^m5hO7QSW3`^QiPihWSSS_g_jLBD]?liaA>QS7jolidP[?I"
    A$ = A$ + ">N4GNNPEQW97G=nLnk:kbaO6mS[TYgM<I\:hLW`Ukb:SD8B[EmScSE9kC[Ii"
    A$ = A$ + "XJLki#EKXW97GI[V:IOZMEDn4l[PS7]m`IG3SAlCWS[VcYZ?loEUX8<IlhZi"
    A$ = A$ + "L6jK^O_hIZfO\lFI7_W97G=71ELNU\[Bn\[mETS[6[2jOYk<EYjGHZMEDfmV"
    A$ = A$ + "3Hn`Lm^jKn?K>>k3S?37oIHG5nL4NgLckPSGI[Yc>Nl:>nT_EXTGTGLLOfLL"
    A$ = A$ + "f>WWQS3maSHlhOjh:hh\o=#QS`aEfAC=G>57G=FQ:kH[Vg=jkTSK5_GaOc]c"
    A$ = A$ + "PNRScSRS_ZlQ#lKOe\[bAhhkRYLlZe<Q3<GD=6m8dI;MEi]SkP#n^\RUeLIB"
    A$ = A$ + "e^cLLcai#57GIg>Emn4>NNm02di3abfaGaOc?SokLiiAbaESARUQlkn9Jk`X"
    A$ = A$ + "N2nBoXlQjglMUb:Old^8K[:\_D`Mo7j_3n?`\?W:k?obn^94G\VPIoD8kSWR"
    A$ = A$ + "O;GNcPmOBibKfoHUW;=#n>9#EVDng;elaQ^9[7bLlZO7i?kOEaj7PkT8^<7o"
    A$ = A$ + "F4WhgnD]M80KS:eMUbE?75f?;Qj=nIEcOEmllO3NQbO>YBg<he3HZ?4CI[_\"
    A$ = A$ + "?A5]EZV?>0[7HKJEmkEn9K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:[CihMj:caofogILWO6^o#fQ"
    A$ = A$ + "S[6?>G7[\CHDG`bPb?6NF>>Kk1<7?^<Dm=nMhhMUEd_B083Ll#o4ZlQihMjZ"
    A$ = A$ + "MVciWbHEV`EaLSbWUE<VK<>>5bf30_gb<kKjkS7U]1?;7OUoF92H\J7QS?9X"
    A$ = A$ + "\QTBGYTg:>NW^bLLMXbnQ1fIlhC6gHUNGiWaO6LLT>kbaWjGdEmI[VOi>Ll>"
    A$ = A$ + "MeGA>^BG`O[;K;<nmIoFS2X]QJ<fZeb6O787Z6;iIhhZeoA=NH5?<G6ZFSmY"
    A$ = A$ + "UEeH3EfdL:7_CGYBgEjegM`eIMfQm\UIenR2m5V3ALELlEmgX:;MLlM\Ql^L"
    A$ = A$ + "lZk5>EIMbgCPo0CUV:>ndeeE5n:baac?[_bZRScb1j?UcOfV7WUS?eViMkK:"
    A$ = A$ + "EOf:i_[\fI[Dh_LgI=PFY[DiEnIOJLL<OnlJ6[l;P#_MVl2n[_ho7Y9l_J#_"
    A$ = A$ + "S_73od7?gE`5ZF[2EI1l:U_24go8Ljan?#f_0V77VbW2VOfTb:NNl\\_E<;C"
    A$ = A$ + "XN9:7\oYTCc9jZ\_a:W>OR[140??ahIXm<olcRLm#nk3ZWc?C9GLMAW<cYGl"
    A$ = A$ + "gllVAjYNn>nD#UlgEFE??c_AK6EnXNgEjZ\_H<okEjegM`fm;NFU?4lZc;T^"
    A$ = A$ + "EfPDUoMbe>oFGn<=^0[lSR[BK8SAjToNAlocf]MGoCi:m1KKP[^nf```````"
    A$ = A$ + "```````````````hn0f?hicDoSdW9==oZ>[XEo>B3ecklKLEn1]Ya7nY=f_4"
    A$ = A$ + "0OFe:di?nHmBELkTI8_kFnoD#gN8GMFNNFiGgn=7L7enlBU7X^\:DeNNROR;"
    A$ = A$ + "h7Mnb]9lW9n_:DV[R;nMU\0iMENLgLa71DW;:>LUgUMkTOMekH=XELlZc1cT"
    A$ = A$ + "dSGojZhgiWhDaMU>LbId6]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T[ck\EC57W"
    A$ = A$ + "SGWN1OKAI[5EOXlkc[S:c9E[Y[ZMF57?gW0jkQScGE>Ngn921eH>Ndigde`X"
    A$ = A$ + "c6eA0]??;77mi[jONU_:5SYI7>NU<Faac]oEk=U_bLl0Qn]RSTG7S[PS?=oh"
    A$ = A$ + "#gn]XSo2^IeM577?dWhdkJThiEgAGA8Kc_:>nTm;EW?Q3O_\j_acn:ca3Tgg"
    A$ = A$ + "MHl3Io#6?Wc7Mn1^6Z_`_5]1bnk=ni\_J3oN`aIo1W:N8OEn>>X3Ho47NNf?"
    A$ = A$ + "^Qg;[obci<WnacaNf:kom0b]A#I9K37lnH^=Zd[BomERS7#a[OTf;MBnEIC["
    A$ = A$ + "ZWG=7h\lg=?I^L^SOR;\WBU_R[JO7bfTFI?C>MZl9LIKIQfMZhXdOg=gk>hj"
    A$ = A$ + "ii;nX]EJGnafS4kWPY?G]>jMaQ;[EonZd?g?LWnCE>V:KLLSo>o<n_kdCg=W"
    A$ = A$ + "c````````````````````````````````````````````````````````hm5"
    A$ = A$ + "MgINIO:l>g]NC_S0acFMo5Rd;7_En<jYYo4iLEL[bkEgSQMn^mMZWDj\^hOd"
    A$ = A$ + "dlM5[l?CX\>aoHW[kFUNC_o2Giki[:GCCoYUY9gSR8NC_73gYL]cMKHGlcYm"
    A$ = A$ + ">eY_cHR?8;l=1CRGnnO];]Dn;K>0OT`:o6Wj>NMWk7aEa3Lb9gkQ[:kA0nef"
    A$ = A$ + "^l6nTCf?1_:TKkf978]gY>mM6:oUZbo\ce9:O0OTFQ?MRe_lM4hTdWmQOA8R"
    A$ = A$ + "Sj>D8BcLIBiC2EYo4of=h_C^753^;gVDiWhDjP80M4l7NMn:JUn7nM^#>biY"
    A$ = A$ + "bGX7HBJRjdkVWNeLlEnC?4?foiQW]bGf[hhZWEagDYMW_a]:m[loOZdGi7Ki"
    A$ = A$ + "hDiGMEb3O7NRhbnl]^jY:iWmU^En9j9YIWOinM1?2>>?F1fGfcS]=N?emG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QQQQQQQQQQQQa[5noC#%%L2"
    btemp$ = ""
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$, m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m
    BASIMAGE1& = _COPYIMAGE(v&): _FREEIMAGE v&
END FUNCTION

SUB SaveAsBMP (filename AS STRING)

    'This SUB adapted from SAVEIMAGE SUB from the QB64 wiki

    image& = _NEWIMAGE(_WIDTH - 200, _HEIGHT, 32)
    _PUTIMAGE (0, 0), _DISPLAY, image&

    bytesperpixel& = _PIXELSIZE(image&)
    'IF bytesperpixel& = 0 THEN PRINT "Text modes unsupported!": END
    IF bytesperpixel& = 1 THEN bpp& = 8 ELSE bpp& = 24
    x& = _WIDTH(image&)
    y& = _HEIGHT(image&)
    b$ = "BM????QB64????" + MKL$(40) + MKL$(x&) + MKL$(y&) + MKI$(1) + MKI$(bpp&) + MKL$(0) + "????" + STRING$(16, 0) 'partial BMP header info(???? to be filled later)
    IF bytesperpixel& = 1 THEN
        FOR c& = 0 TO 255 ' read BGR color settings from JPG image + 1 byte spacer(CHR$(0))
            cv& = _PALETTECOLOR(c&, image&) ' color attribute to read.
            b$ = b$ + CHR$(_BLUE32(cv&)) + CHR$(_GREEN32(cv&)) + CHR$(_RED32(cv&)) + CHR$(0) 'spacer byte
        NEXT
    END IF
    MID$(b$, 11, 4) = MKL$(LEN(b$)) ' image pixel data offset(BMP header)
    lastsource& = _SOURCE
    _SOURCE image&
    IF ((x& * 3) MOD 4) THEN padder$ = STRING$(4 - ((x& * 3) MOD 4), 0)
    FOR py& = y& - 1 TO 0 STEP -1 ' read JPG image pixel color data
        r$ = ""
        FOR px& = 0 TO x& - 1
            c& = POINT(px&, py&) 'POINT 32 bit values are large LONG values
            IF bytesperpixel& = 1 THEN r$ = r$ + CHR$(c&) ELSE r$ = r$ + LEFT$(MKL$(c&), 3)
        NEXT px&
        d$ = d$ + r$ + padder$
    NEXT py&
    _SOURCE lastsource&
    MID$(b$, 35, 4) = MKL$(LEN(d$)) ' image size(BMP header)
    b$ = b$ + d$ ' total file data bytes to create file
    MID$(b$, 3, 4) = MKL$(LEN(b$)) ' size of data file(BMP header)
    IF LCASE$(RIGHT$(filename$, 4)) <> ".bmp" THEN ext$ = ".bmp"
    f& = FREEFILE
    OPEN filename$ + ext$ FOR OUTPUT AS #f&: CLOSE #f& ' erases an existing file
    OPEN filename$ + ext$ FOR BINARY AS #f&
    PUT #f&, , b$
    CLOSE #f&

    _FREEIMAGE image&

END SUB

SUB Smooth
    FOR x = 0 TO _WIDTH - 201
        FOR y = 0 TO _HEIGHT - 1
            p1~& = POINT(x, y)
            p2~& = POINT(x + 1, y)
            p3~& = POINT(x, y + 1)
            p4~& = POINT(x + 1, y + 1)
            p5~& = POINT(x - 1, y)
            p6~& = POINT(x, y - 1)
            p7~& = POINT(x - 1, y - 1)
            p8~& = POINT(x - 1, y + 1)
            p9~& = POINT(x + 1, y - 1)
            r = _RED32(p1~&) + _RED32(p2~&) + _RED32(p3~&) + _RED32(p4~&) + _RED32(p5~&) + _RED32(p6~&) + _RED32(p7~&) + _RED32(p8~&) + _RED32(p9~&)
            g = _GREEN32(p1~&) + _GREEN32(p2~&) + _GREEN32(p3~&) + _GREEN32(p4~&) + _GREEN32(p5~&) + _GREEN32(p6~&) + _GREEN32(p7~&) + _GREEN32(p8~&) + _GREEN32(p9~&)
            b = _BLUE32(p1~&) + _BLUE32(p2~&) + _BLUE32(p3~&) + _BLUE32(p4~&) + _BLUE32(p5~&) + _BLUE32(p6~&) + _BLUE32(p7~&) + _BLUE32(p8~&) + _BLUE32(p9~&)
            PSET (x, y), _RGB(r / 9, g / 9, b / 9)
        NEXT
    NEXT
END SUB

SUB DrawMenu
    LINE (_WIDTH - 200, 0)-(_WIDTH, _HEIGHT), _RGB(96, 96, 96), BF
    LINE (_WIDTH - 200, 0)-(_WIDTH - 195, _HEIGHT), _RGB(164, 164, 164), BF
    _PUTIMAGE (_WIDTH - 190, 10), menu&

    IF quads = 1 THEN
        LINE (_WIDTH - 178, 64)-(_WIDTH - 143, 110), _RGBA(255, 255, 0, 100), BF
        LINE (_WIDTH - 178, 64)-(_WIDTH - 143, 110), _RGB(255, 255, 0), B
    END IF
    IF quads = 2 THEN
        LINE (_WIDTH - 142, 64)-(_WIDTH - 102, 110), _RGBA(255, 255, 0, 100), BF
        LINE (_WIDTH - 142, 64)-(_WIDTH - 102, 110), _RGB(255, 255, 0), B
    END IF
    IF quads = 3 THEN
        LINE (_WIDTH - 97, 64)-(_WIDTH - 58, 110), _RGBA(255, 255, 0, 100), BF
        LINE (_WIDTH - 97, 64)-(_WIDTH - 58, 110), _RGB(255, 255, 0), B
    END IF
    IF quads = 4 THEN
        LINE (_WIDTH - 56, 64)-(_WIDTH - 18, 110), _RGBA(255, 255, 0, 100), BF
        LINE (_WIDTH - 56, 64)-(_WIDTH - 18, 110), _RGB(255, 255, 0), B
    END IF

    Text _WIDTH - 55, 319, 22, _RGB(0, 0, 0), STR$(brushsize)
    Text _WIDTH - 57, 317, 22, _RGB(255, 255, 0), STR$(brushsize)

    LINE (_WIDTH - 160, 180)-(_WIDTH - 40, 300), _RGB(164, 164, 164), BF
    LINE (_WIDTH - 160, 180)-(_WIDTH - 40, 300), _RGB(255, 255, 255), B
    CIRCLE (_WIDTH - 100, 240), brushsize, _RGB(0, 0, 0)
    IF brushsize > 1 THEN PAINT (_WIDTH - 100, 240), _RGB(0, 0, 0)

    IF randfill = 1 THEN ran$ = "ON" ELSE ran$ = "OFF"
    Text _WIDTH - 32, 456, 22, _RGB(0, 0, 0), ran$
    Text _WIDTH - 34, 454, 22, _RGB(255, 255, 0), ran$

END SUB

   

Find my programs here in Dav's QB64 Corner
Reply
#5
This morning I was messing around with Text to see if I could get font's going with it but ran into anti-alias problems when I tried to scale letters. Looking at your update, I thought you figured it out, but no, looks like that menu was drawn somewhere else and then copied like an image. Looks very good though! Thumbs up!

   
b = b + ...
Reply
#6
Hey, happy looking fish!  Yep, I Couldn't get a sharp enough small text to my liking so I went with an image for the menu, made it in Paintshop pro.  I also played around trying to get a better looking 'Text' font, using the Antialiasing SUB and layering several color 'Text' but it didn't work out well enough.  I am still using 'Text' for the brush size number and random fill On/Off.

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#7
This was too much fun to fiddle with. 
I added 2 button commands (with no menu support) to see how they'd work.
Changing the brush color is useful. The eraser...not so much.
Code: (Select All)
            Case "B"
'change brush color
                If blk& = _RGB(0, 0, 0) Then
                    blk& = ColorPicker&(200, 150)
                Else
                    blk& = _RGB(0, 0, 0)
                End If
            Case "E"
'turn eraser on and off
                If blk& = _RGB(0, 0, 0) Then
                    blk& = wht&
                Else
                    blk& = _RGB(0, 0, 0)
                End If
Reply
#8
Looking good!
Multiple undo's would be good, and I was also a bit lost looking for an Exit... finally used the old "three-finger salute".
Reply
#9
Thank's for the save option ! 'Smooth' disappeared ?
Why not yes ?
Reply
#10
@PhilOfPerth: Thanks for the suggestion.  I'll work on a multi-livel undo.  You can also press ESC to end the program.

@James D Jarvis:  Cool.  I like it.  May I add those in the next version? I was going to add D for selecting a draw color.  The Eraser idea actually makes a neat effect - press and hold E while drawing and it draws a dotted line.  Thanks for your testing.

@euklides:  Smooth is still there, it was renamed to Antialiasing.  PRESS A to do that now.  I needed S to do the SAVE.  I'm planning on adding L for LOAD an image.

I may change the menu to buttons (keeping the keyboard shortcuts too), also show the current Brush & Fill colors somehow.

Thanks everybody for your feedback.

- Dav

Find my programs here in Dav's QB64 Corner
Reply




Users browsing this thread: 3 Guest(s)