Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
08-30-2023, 02:43 AM
(This post was last modified: 09-12-2023, 10:04 AM by Dav.)
I'm re-doing the Doodle draw program started a few years ago, which records what you draw on the screen and plays it back to you, showing a hand doing the drawing. This one is using a new drawing method. Would appreciate some testers. See it it works smoothly for you. I'm having a little display glitches now and then, can't seem to narrow down why. Especially after changing the color (Pressing C), the mouse seems to hang in Linux sometimes. And the hand jumps around sometimes oddly. Probably I'm coding mouse usage wrong.
Left Click to draw, Right Click to clear screen. D = Draws, F = FILL, C = Change color, SPACE restarts. Use +/- to change brush size. Press ESC to stop drawing and play back what you drew.
Eventually this will save/load the drawing files, but for now it just works without saving any files. Just draw and press ESC, it will playback what you just drew. Trying to get the basic bugs out of the way first.
The .BAS source is kind of large, so here it is for download.
( EDIT: Download removed. Get the lastest version posted HERE)
- Dav
Posts: 1,587
Threads: 59
Joined: Jul 2022
Reputation:
52
08-30-2023, 12:12 PM
(This post was last modified: 08-30-2023, 12:13 PM by mnrvovrfc.
Edit Reason: Forgot to clarify
)
As usual, amazing job, and I like the drawing hand and forearm!
The area around line 63 might benefit from the following:
Code: (Select All) $IF WIN THEN
'This makes no sense, but it fixed the glitch in windows.
DO UNTIL _MOUSEX = mx AND _MOUSEY = my
mi = _MOUSEINPUT
_MOUSEMOVE mx, my
LOOP
$END IF
This fixes the mouse problem on Linux after the color dialog is used.
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
08-30-2023, 12:14 PM
(This post was last modified: 08-30-2023, 01:19 PM by Dav.)
I think the jumping hand glitch is gone. Had to add a small _DELAY after choosing a new color for some reason. And I removed my horrible Color Picker and used QB64's beautiful _COLORCHOOSERDIALOG instead (forgot it was there!).
After removing my colorpicker function the source is cut in half, so here it is. This seems to replay drawings better now.
- Dav
Code: (Select All) '==========
'DOODLE.BAS v1.2
'==========
'Little screen drawing/recording program.
'Draw something on the screen using the mouse,
'Your drawing will be recorded and played back.
'A Hand will draw it back on the screen.
'Coded by Dav, AUGUST/2023
'==========
'HOW TO USE:
'==========
'Left Click to draw using the mouse
'Right click mouse to clear the screen.
'D = DRAW mode (default - drawing on screen)
'F = FILL mode (like paint - fills area with color)
'C = Change color (selects a new one)
'+/- to Change brush size.
'SPACE erases recording and starts over.
'Pressing ESC will stop the recording and start playback.
'Pressing ESC during playback will stop the playback.
'==========================================================
'=== Setup nice screen size based on users desktop size
Screen _NewImage(Int(_DesktopWidth * .75), Int(_DesktopHeight * .75), 32)
_Delay .25
hand& = BASIMAGE1&
'========
StartOver:
'========
'=== settings
BrushSize% = 3 'size of brush
BrushColor& = _RGB(0, 0, 0) 'color of brush
CanvasColor& = _RGB(255, 255, 255)
DoodleLimit = 500000 'how large doodle string can be (this is about 3 minutes)
Doodle$ = ""
Mode = 0 '0=draw with color, 1=fill with color (paint)
Hand = 1 'Flag for showing hand image or not, default is on
'=== main drawing loop begins
Cls , CanvasColor&
Do
While _MouseInput: Wend
mx = _MouseX: my = _MouseY
If mx > 0 And mx < _Width And my > 0 And my < _Height Then
If _MouseButton(1) Then
If Mode = 0 Then
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 j = 1 To BrushSize%
Circle (mx + dx * i, my + dy * i), j, BrushColor&
Next
Next
Else
For j = 1 To BrushSize% Step .36
Circle (mx, my), j, BrushColor&
Next
End If
Else
SPAINT mx, my, BrushColor&
End If
lastmx = mx: lastmy = my
stilldown = 1
Btn$ = "D" 'button pressed down marker
Else
stilldown = 0
Btn$ = "U" 'button up marker, not pressed
End If
'make x position data
x$ = _Trim$(Str$(mx)) 'x position
If Len(x$) = 3 Then x$ = "0" + x$
If Len(x$) = 2 Then x$ = "00" + x$
If Len(x$) = 1 Then x$ = "000" + x$
'make y position data
y$ = _Trim$(Str$(my)) 'y position
If Len(y$) = 3 Then y$ = "0" + y$
If Len(y$) = 2 Then y$ = "00" + y$
If Len(y$) = 1 Then y$ = "000" + y$
'build onto string data only if StartedDrawing flag on
DoodleTemp$ = DoodleTemp$ + (Btn$ + x$ + y$)
End If
'if right button clicked
If _MouseButton(2) Then
Cls , CanvasColor&
DoodleTemp$ = DoodleTemp$ + "C00000000" 'clear screen if right click
End If
'add to image data only if changed from previous x/y data
If DoodleTemp$ <> OldDoodleTemp$ Then
Doodle$ = Doodle$ + DoodleTemp$
End If
'save old data
OldDoodleTemp$ = DoodleTemp$
'reset info
DoodleTemp$ = ""
'=====================================================
'Handle keyboard input
keys$ = UCase$(InKey$)
If keys$ = Chr$(27) Then Exit Do
If keys$ = "C" Then
_MouseMove mx, my
pick& = _ColorChooserDialog("Select a color", _RGB32(0, 255, 255))
_MouseMove mx, my
_Delay .5
'This makes no sense, but it fixed the glitch in windows.
$If WIN Then
Do Until _MouseX = mx And _MouseY = my
mi = _MouseInput
_MouseMove mx, my
Loop
$End If
If pick& <> 0 Then
BrushColor& = pick&
Doodle$ = Doodle$ + "K" + MKL$(BrushColor&) + "0000"
End If
End If
If keys$ = "F" Then
Mode = 1: Doodle$ = Doodle$ + "M10000000"
End If
If keys$ = "D" Then
Mode = 0: Doodle$ = Doodle$ + "M00000000"
End If
If keys$ = "+" Then
If BrushSize% < 100 Then
BrushSize% = BrushSize% + 1
Doodle$ = Doodle$ + "B" + MKL$(BrushSize%) + "0000"
End If
End If
If keys$ = "-" Then
If BrushSize% > 1 Then
BrushSize% = BrushSize% - 1
Doodle$ = Doodle$ + "B" + MKL$(BrushSize%) + "0000"
End If
End If
If keys$ = " " Then GoTo StartOver
_KeyClear
'==========================================================
_Limit 30
'==== below is info only....you can comment out if want
Color _RGB(255, 255, 255), _RGB(196, 0, 0)
Locate 1, 1: Print "ESC STOPS RECORDING ";
Color _RGB(255, 255, 255), _RGB(0, 0, 0)
Print " (C)olor, (+/-) BrushSize:"; RTrim$(Str$(BrushSize%)); ", ";
If Mode = 0 Then
Color _RGB(255, 255, 0), _RGB(0, 0, 0): Print "(D)raw ";
Color _RGB(255, 255, 255), _RGB(0, 0, 0): Print "(F)ill ";
Else
Color _RGB(255, 255, 255), _RGB(0, 0, 0): Print "(D)raw ";
Color _RGB(255, 255, 0), _RGB(0, 0, 0): Print "(F)ill ";
End If
'======================================================
'See if set limit is reached. If so, stop recording
If Len(Doodle$) > DoodleLimit Then Exit Do
Loop
'=== Make simple 24-byte doodle Header with drawing size info
Head$ = "DDV1" 'Dav's Doodle v1 marker
Head$ = Head$ + MKL$(_Width)
Head$ = Head$ + MKL$(_Height)
Head$ = Head$ + Space$(12) 'extra space for future info.
'Add it to beginning of Doodle$ string
Doodle$ = Head$ + Doodle$
'==================================================
'============ Playback what we recorded...
'==================================================
'Load Doodle info from header
If Mid$(Doodle$, 1, 4) <> "DDV1" Then Cls: Print "Invalid Header.": End
sw = CVL(Mid$(Doodle$, 1 + 4, 4))
sh = CVL(Mid$(Doodle$, 1 + 8, 4))
'Open screen size
Screen _NewImage(sw, sh, 32)
'=== set to defaults
Mode = 0
stilldown = 0
CanvasColor& = _RGB(255, 255, 255)
BrushColor& = _RGB(0, 0, 0)
BrushSize% = 3
Cls , CanvasColor&
_Display
_Delay 1
'Play data...
'Skip over header, play data
For d = 25 To Len(Doodle$) Step 9
Btn$ = Mid$(Doodle$, d, 1) 'get marker (B,U or C)
mx = Val(Mid$(Doodle$, d + 1, 4)) 'get x info
my = Val(Mid$(Doodle$, d + 5, 4)) 'get y info
If Btn$ = "D" Then
If Mode = 0 Then
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 j = 1 To BrushSize%
Circle (mx + dx * i, my + dy * i), j, BrushColor&
Next
Next
Else
For j = 1 To BrushSize% Step .36
Circle (mx, my), j, BrushColor&
Next
End If
Else
SPAINT mx, my, BrushColor&
End If
lastmx = mx: lastmy = my
stilldown = 1
handx = mx: handy = my
End If
If Btn$ = "U" Then
stilldown = 0
handx = mx: handy = my
End If
If Btn$ = "C" Then
Cls , CanvasColor&: stilldown = 0
'_Display
End If
If Btn$ = "K" Then
BrushColor& = CVL(Mid$(Doodle$, d + 1, 4)): stilldown = 0
End If
If Btn$ = "M" Then
If Mid$(Doodle$, d + 1, 1) = "1" Then Mode = 1
If Mid$(Doodle$, d + 1, 1) = "0" Then Mode = 0
End If
If Btn$ = "B" Then
BrushSize% = CVL(Mid$(Doodle$, d + 1, 4))
End If
If Hand = 1 Then
'save current screen
page& = _CopyImage(_Display)
'shaw drawing hand over it
_PutImage (handx - 44, handy - 24), hand&
_Display
_PutImage (0, 0), page&
_FreeImage page&
Else
_Display
End If
If InKey$ = Chr$(27) Then Exit For
_Limit 45 'play a little faster than recorded, we usually draw slow.
Next
If Hand = 1 Then
_Delay .5
'done....move hand off screen here...
For xx = handx To _Width Step 5
handy = handy + 5
'save current screen
page& = _CopyImage(_Display)
'shaw drawing hand over it
_PutImage (xx - 44, handy - 24), hand&
_Display
_PutImage (0, 0), page&
_FreeImage page&
_Limit 100
Next
End If
_FreeImage hand& 'release me...
Sleep
'just for info
Locate 1, 1
Print "Length of recording ->:"; Len(Doodle$)
Print "Compressed size is -->:"; Len(_Deflate$(Doodle$))
Print "File saving not added yet."
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
Function BASIMAGE1&
v& = _NewImage(357, 600, 32)
Dim m As _MEM: m = _MemImage(v&)
A$ = ""
A$ = A$ + "haIkM7STLSLV66N?2j2X8FGM0TQLE4[W\6G5CXEfdLLD4DVdL_1j<\6[QdAH"
A$ = A$ + "^FLWD<b1X11Z2X:0lU9`SaC`VLj^IgEWo_Cb\#EeGnjGn?n2000000000000"
A$ = A$ + "00000000000000000000000000004bOncoS_n7n[om_n3oh?m_EnmYoJ2PkX"
A$ = A$ + "BomgnkoKO7]I0>OUfkdNLI?cSY=3`iHJC^dPoSo`ok_N>6egn?mGnGJcGLOj"
A$ = A$ + "[o\On2Q=n\;Zk;^fS7[dV;dVkOOjcolGWZlcdb_FoiLi]Coe9L7EV5;=gYk?"
A$ = A$ + "^^gh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<W]dc;"
A$ = A$ + "`AjEOlRhnhSDB?c07Ygia`WV<YTN^1>:[]9_deU\V<9TN^1>:_BCN;Wg<LDB"
A$ = A$ + "?k07Q]dTOdNUC?ObmDji7H_]eVlF_^<PSDji7H_Y9C_;m<4\WdTYgUN6J>oo"
A$ = A$ + "R3cl%%%0"
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
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
@mnrvovrfc, Sorry we posted at the same time! I'll look over your fix now. Thanks!
- Dav
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
You're right, @mnrvovrfc, that did work. I put that in the code. Thank you! I also shortened the delay to .5 as that seems to be enough on my my computer to work. The hand image started as a photo of my hand holding a pencil, I converted it to 16 colors to make it a smaller file size. Thank you for your testing!
- Dav
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
Yes, the hand jumping is gone now using _ColorChooserDialog instead, but I've discovered that the dialog can't be seen when using a screen in _FULLSCREEN. Anyway, after doing a bunch a drawings and seeing no hand glitches I'd say the drawing work is working ok, now will move onto things like file saving/loading, maybe work on a menu of some kind. Speed control/pause during playback. Perhaps add printed TEXT to a drawing. Here's a sample animated drawing. Played back perfect.
- Dav
Posts: 660
Threads: 142
Joined: Apr 2022
Reputation:
58
That's a fun program.
I'm using a windows machine, and I can see _ColorChooserDialog in _fullscreen mode.
Code: (Select All) '=== main drawing loop begins
_FullScreen
Cls , CanvasColor&
just shoved it in there to see what would happen and it worked fine.
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
08-30-2023, 02:57 PM
(This post was last modified: 08-30-2023, 02:58 PM by Dav.)
(08-30-2023, 02:49 PM)James D Jarvis Wrote: That's a fun program.
I'm using a windows machine, and I can see _ColorChooserDialog in _fullscreen mode.
Code: (Select All) '=== main drawing loop begins
_FullScreen
Cls , CanvasColor&
just shoved it in there to see what would happen and it worked fine.
Hmm, and it's working for me too now. Odd. Sometimes yes, sometimes no? I've been doing the Alt+Enter switch. Well, I can live with it. Hey, thanks for trying it out, James!
- Dav
Posts: 723
Threads: 118
Joined: Apr 2022
Reputation:
106
There's definitely a problem displaying the color chooser dialog once in a while under _FULLSCREEN on my windows 7. Maybe it's just a video driver problem on my system.
Whenever the dialog won't appear, if I click on the screen somewhere, Windows plays a system sound (like when clicking out of bounds a defined area) and the color dialog will then appear. So apparently the dialog is opened every-time, but probably just behind my fullscreen window until I click the mouse somewhere and bring it up to view?
If I run this simplified code, and switch in/out of _fullscreen, eventually it will happen (press C to bring up color box, ESC to end, Alt+Enter to go in and out of fullscreen). I ran it 20 times, 4 times the dialog wouldn't appear without clicking on the screen.
- Dav
Code: (Select All) Screen _NewImage(800, 600, 32)
_Display
_FullScreen
Do
If InKey$ = "c" Then
pick& = _ColorChooserDialog("Select a color", _RGB32(0, 255, 255))
End If
Loop Until _KeyHit = 27
Posts: 3,936
Threads: 175
Joined: Apr 2022
Reputation:
216
08-31-2023, 11:48 PM
(This post was last modified: 08-31-2023, 11:52 PM by bplus.)
I tested this on Windows 10 laptop, worked OK QB64pe v3.8
```Screen _NewImage(800, 600, 32)
_Display ' ?
_FullScreen
Do
If InKey$ = "c" Then
pick~& = _ColorChooserDialog("Select a color", _RGB32(0, 255, 255))
End If
Color , pick~&
Cls
_Display
_Limit 60
Loop Until _KeyHit = 27```
Of course not as nice as this one ;-))
https://qb64phoenix.com/forum/showthread...68#pid1368
b = b + ...
|