hello everyone,
i want to create a program similar to the function in powerpoint
that u can draw stuff with "pen" in your presentation
instead, i want to drew on normal desktop screen
i manage to create a GUI that can display what i type on the screen
but have no idea how i can "drew"
any suggestions?
thank you
Drawing on screen
Started by
evan
, May 02 2008 03:28 AM
15 replies to this topic
#1
-
Posted 02 May 2008 - 03:28 AM
See this topic: http://www.autohotke... ... 2016#32016
I've been looking for this for a while but didn't find it until I searched for an answer to this question
I've been looking for this for a while but didn't find it until I searched for an answer to this question
#2
-
Posted 02 May 2008 - 03:55 AM
Bah scratch that. This is the one I've been looking for. Should help you too.
http://www.autohotke... ... draw mouse
http://www.autohotke... ... draw mouse
#3
-
Posted 02 May 2008 - 04:22 AM
nice, exactly what i wanted
probably i will try to combine my TEXT display and the drawing part now
thanks
probably i will try to combine my TEXT display and the drawing part now
thanks
#4
-
Posted 02 May 2008 - 05:46 AM
ehm, interesting program
what it does is not really drawing on active screen
it kind of take a screenshot of the screen
then u draw ontop of it
what it does is not really drawing on active screen
it kind of take a screenshot of the screen
then u draw ontop of it
#5
-
Posted 02 May 2008 - 06:17 AM
Ok, you said desktop, so I thought desktop.
So you just need to modify it a little:
So you just need to modify it a little:
OnExit, Exit Gui, Show, h300 w300, Test hWnd := WinExist("Test") hDC := DllCall("GetDC", UInt, hWnd) color := 0xff OnMessage(0x200, "Draw") Return Draw(wParam, lParam) { Global hDC, color DllCall("SetPixel", UInt, hDC, Int, lParam & 0xFFFF, Int, lParam >> 16, UInt, color) } GuiClose: GuiEscape: Exit: If hDC DllCall("ReleaseDC", UInt, hDC) ExitApp
#6
-
Posted 02 May 2008 - 07:47 AM
finally finished combining =)
CoordMode, Mouse, Screen Black = 000000 Green = 008000 Silver = C0C0C0 Lime = 00FF00 Gray = 808080 Olive = 808000 White = FFFFFF Yellow = FFFF00 Maroon = 800000 Navy = 000080 Red = FF0000 Blue = 0000FF Purple = 800080 Teal = 008080 Fuchsia = FF00FF Aqua = 00FFFF hh := A_ScreenHeight - 51 ww := A_ScreenWidth / 3 ColorChoice = Black LineWidth = 11 xpos=0 ypos=0 word= Gui 2: Color, black Gui 2: Add, Button, Default x-100 y1 gokbt, Gui 2: +LastFound +AlwaysOnTop +ToolWindow -Caption Gui 2: Add, Edit, vword x20 y1 w%ww%, Gui 2: Add, DropDownList, w80 x+20 y1 choose2 vColorChoice gchange, Aqua|Black|Blue|Fuchsia|Gray|Green|Lime|Maroon|Navy|Olive|Purple|Red|Silver|Teal|White|Yellow| Gui 2: Add, DropDownList, w40 x+20 y1 choose4 vLineWidth gchange2, 8|9|10|11|12|14|16|18|20|22|24|26|28|36|48|72| Gui 2: Show, x-1 y%hh% w%A_ScreenWidth% h22 Gui, 1:+LastFound +AlwaysOnTop Gui, 1:-Caption Gui, 1:Color, FF0000 WinSet, TransColor, FF0000 GuiHwnd := WinExist() Gui, 1:Show Gui, 1:Maximize SetTimer, DrawLine, 100 return okbt: Gui 2: Submit, NoHide StringLen, length, ww Send {Ctrl down} Send {a} Send {Ctrl up} Send {del} fontsize := LineWidth * 3 MouseGetPos, xpos, ypos Gui 3: Color, EEAA99 Gui 3: +LastFound +AlwaysOnTop +ToolWindow -Caption WinSet, TransColor, EEAA99 gui 3: font, s%fontsize% C%ColorChoice%, Verdana Gui 3: Add, Text, x1 y1, %word% Gui 3: Show, x%xpos% y%ypos% w%A_ScreenWidth% length= return DrawLine: GetKeyState, state, LButton GetKeyState, state2, Ctrl MouseGetPos, M_x, M_y if state = D if state2 = D { sleep 25 MouseGetPos, M_x2, M_y2 Canvas_DrawLine(GuihWnd, M_x, M_y, M_x2, M_y2, LineWidth, %ColorChoice%) loop 30 { GetKeyState, state, LButton GetKeyState, state2, Ctrl if state = U { break } else if state2 = U { break } sleep 25 MouseGetPos, M_x3, M_y3 Canvas_DrawLine(GuihWnd, M_x3, M_y3, M_x2, M_y2, LineWidth, %ColorChoice%) sleep 25 MouseGetPos, M_x2, M_y2 Canvas_DrawLine(GuihWnd, M_x3, M_y3, M_x2, M_y2, LineWidth, %ColorChoice%) } } return Canvas_DrawLine(hWnd, p_x1, p_y1, p_x2, p_y2, p_w, p_color) ; r,angle,width,color) { p_x1 -= 1, p_y1 -= 1, p_x2 -= 1, p_y2 -= 1 hDC := DllCall("GetDC", UInt, hWnd) hCurrPen := DllCall("CreatePen", UInt, 0, UInt, p_w, UInt, Convert_BGR(p_color)) DllCall("SelectObject", UInt,hdc, UInt,hCurrPen) DllCall("gdi32.dll\MoveToEx", UInt, hdc, Uint,p_x1, Uint, p_y1, Uint, 0 ) DllCall("gdi32.dll\LineTo", UInt, hdc, Uint, p_x2, Uint, p_y2 ) DllCall("ReleaseDC", UInt, 0, UInt, hDC) ; Clean-up. DllCall("DeleteObject", UInt,hCurrPen) } Convert_BGR(RGB) { StringLeft, r, RGB, 2 StringMid, g, RGB, 3, 2 StringRight, b, RGB, 2 Return, "0x" . b . g . r } return change: Gui 2: submit Gui 2: Color, %ColorChoice% Gui 2: Show, x-1 y%hh% w2000 h22 return change2: Gui 2: submit Gui 2: Show, x-1 y%hh% w2000 h22 return esc::exitapp ^r:: { WinSet, Redraw,, ahk_id %GuiHwnd% Gui 3: Cancel return }
#7
-
Posted 02 May 2008 - 09:14 AM
#8
-
Posted 02 May 2008 - 09:19 AM
working on it for 3 hrs already
phew, didnt waste my afford
i was planning to use this on my video edits
(before loading it up in Movie editor)
or maybe sometimes drawing @_@
o btw, this program does not dot dot dot dot dot to paint lines
it connects the dots like the line function in Paint
phew, didnt waste my afford
i was planning to use this on my video edits
(before loading it up in Movie editor)
or maybe sometimes drawing @_@
o btw, this program does not dot dot dot dot dot to paint lines
it connects the dots like the line function in Paint
#10
-
Posted 02 May 2008 - 09:44 AM
little bugfix:
CoordMode, Mouse, Screen Black = 000000 Green = 008000 Silver = C0C0C0 Lime = 00FF00 Gray = 808080 Olive = 808000 White = FFFFFF Yellow = FFFF00 Maroon = 800000 Navy = 000080 Red = FF0000 Blue = 0000FF Purple = 800080 Teal = 008080 Fuchsia = FF00FF Aqua = 00FFFF hh := A_ScreenHeight - 51 ww := A_ScreenWidth / 3 ColorChoice = Black LineWidth = 11 xpos=0 ypos=0 word= Gui 2: Color, black Gui 2: Add, Button, Default x-100 y1 gokbt, Gui 2: +LastFound +AlwaysOnTop +ToolWindow -Caption Gui 2: Add, Edit, vword x20 y1 w%ww%, Gui 2: Add, DropDownList, w80 x+20 y1 choose2 vColorChoice gchange, Aqua|Black|Blue|Fuchsia|Gray|Green|Lime|Maroon|Navy|Olive|Purple|Red|Silver|Teal|White|Yellow| Gui 2: Add, DropDownList, w40 x+20 y1 choose4 vLineWidth gchange2, 8|9|10|11|12|14|16|18|20|22|24|26|28|36|48|72| Gui 2: Show, x-1 y%hh% w%A_ScreenWidth% h22 Gui, 1:+LastFound +AlwaysOnTop Gui, 1:-Caption Gui, 1:Color, FF0000 WinSet, TransColor, FF0000 GuiHwnd := WinExist() Gui, 1:Show Gui, 1:Maximize SetTimer, DrawLine, 100 return okbt: Gui 2: Submit, NoHide StringLen, length, ww Send {Ctrl down} Send {a} Send {Ctrl up} Send {del} fontsize := LineWidth * 3 MouseGetPos, xpos, ypos [color=red]Gui 3: Destroy[/color] Gui 3: Color, EEAA99 Gui 3: +LastFound +AlwaysOnTop +ToolWindow -Caption WinSet, TransColor, EEAA99 gui 3: font, s%fontsize% C%ColorChoice%, Verdana Gui 3: Add, Text, x1 y1, %word% Gui 3: Show, x%xpos% y%ypos% w%A_ScreenWidth% length= return DrawLine: GetKeyState, state, LButton GetKeyState, state2, Ctrl MouseGetPos, M_x, M_y if state = D if state2 = D { sleep 25 MouseGetPos, M_x2, M_y2 Canvas_DrawLine(GuihWnd, M_x, M_y, M_x2, M_y2, LineWidth, %ColorChoice%) loop 30 { GetKeyState, state, LButton GetKeyState, state2, Ctrl if state = U { break } else if state2 = U { break } sleep 25 MouseGetPos, M_x3, M_y3 Canvas_DrawLine(GuihWnd, M_x3, M_y3, M_x2, M_y2, LineWidth, %ColorChoice%) sleep 25 MouseGetPos, M_x2, M_y2 Canvas_DrawLine(GuihWnd, M_x3, M_y3, M_x2, M_y2, LineWidth, %ColorChoice%) } } return Canvas_DrawLine(hWnd, p_x1, p_y1, p_x2, p_y2, p_w, p_color) ; r,angle,width,color) { p_x1 -= 1, p_y1 -= 1, p_x2 -= 1, p_y2 -= 1 hDC := DllCall("GetDC", UInt, hWnd) hCurrPen := DllCall("CreatePen", UInt, 0, UInt, p_w, UInt, Convert_BGR(p_color)) DllCall("SelectObject", UInt,hdc, UInt,hCurrPen) DllCall("gdi32.dll\MoveToEx", UInt, hdc, Uint,p_x1, Uint, p_y1, Uint, 0 ) DllCall("gdi32.dll\LineTo", UInt, hdc, Uint, p_x2, Uint, p_y2 ) DllCall("ReleaseDC", UInt, 0, UInt, hDC) ; Clean-up. DllCall("DeleteObject", UInt,hCurrPen) } Convert_BGR(RGB) { StringLeft, r, RGB, 2 StringMid, g, RGB, 3, 2 StringRight, b, RGB, 2 Return, "0x" . b . g . r } return change: Gui 2: submit Gui 2: Color, %ColorChoice% Gui 2: Show, x-1 y%hh% w2000 h22 return change2: Gui 2: submit Gui 2: Show, x-1 y%hh% w2000 h22 return esc::exitapp ^r:: { WinSet, Redraw,, ahk_id %GuiHwnd% Gui 3: Cancel return }
#11
-
Posted 02 May 2008 - 09:44 AM
#12
-
Posted 02 May 2008 - 12:05 PM
yes thats the script i developed in.
not sure if u are the author, but i will quote a mail here:
which its on another thread, that i develop it to act like a "aimer"
<!-- m -->http://www.autohotke...pic.php?t=26092<!-- m -->
(for people that are interested in like a line generating in the center)
anyhow since its working, i will not check this thread as often
so hopefully it will eventually help some people that want to drawing
PS*thanks for providing a working script
without the script, i cant develop this
not sure if u are the author, but i will quote a mail here:
which its on another thread, that i develop it to act like a "aimer"
<!-- m -->http://www.autohotke...pic.php?t=26092<!-- m -->
(for people that are interested in like a line generating in the center)
anyhow since its working, i will not check this thread as often
so hopefully it will eventually help some people that want to drawing
PS*thanks for providing a working script
without the script, i cant develop this
#13
-
Posted 02 May 2008 - 04:45 PM
Cool script(s)! It might be improved by putting the gui at the bottom of the workspace (so sideways or double height taskbars are supported). I wish there was a palette on the GUI too... Maybe 8 squares of common colors and a more ddl?
#15
-
Posted 02 May 2008 - 06:46 PM