AzKay Posted September 20, 2007 Share Posted September 20, 2007 Any ideas on drawing "on screen"? For example, mspaint, but drawing on the screen using coords, and colour. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 20, 2007 Share Posted September 20, 2007 (edited) Any ideas on drawing "on screen"?For example, mspaint, but drawing on the screen using coords, and colour.Grease pencil is OK on CRTs, but messy. Don't even TRY felt tip markers! My kids experimented on my monitors with crayons years ago, but it doesn't fill in well (thankfully)... Edited September 20, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2007 Author Share Posted September 20, 2007 (edited) OH YOU CRIMINAL. Now I gotta clean the screen. AGAIN. TIME TO REPHRASE. Ive seen a few scripts that have used functions, dllcalls I believe, to draw lines. I want that, But to draw 1x1 pixels. With colour. Edited September 20, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Zedna Posted September 20, 2007 Share Posted September 20, 2007 Search for SetPixel Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Developers Jos Posted September 20, 2007 Developers Share Posted September 20, 2007 http://www.autoitscript.com/forum/index.ph...st&p=171240 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 20, 2007 Share Posted September 20, 2007 This was another thread about drawing lines on the screen: Draw?, Nothing too hard, but I can't figure this outHope that helps. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 20, 2007 Share Posted September 20, 2007 Grease pencil is OK on CRTs, but messy. Don't even TRY felt tip markers! My kids experimented on my monitors with crayons years ago, but it doesn't fill in well (thankfully)... Hmm... Sharpies work too!Just use some 70% Isopropyl to clean it off. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2007 Author Share Posted September 20, 2007 Mmm, Works great. Ill post my script soon. Thanks :3 # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2007 Author Share Posted September 20, 2007 Finnished script:http://www.autoitscript.com/forum/index.php?showtopic=53695 # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Nahuel Posted September 20, 2007 Share Posted September 20, 2007 This was another thread about drawing lines on the screen: Draw?, Nothing too hard, but I can't figure this out Hope that helps. Yeah, that's my thread I don't wanna open a new thread and since you guys are talking about this, I'll ask my question. I wanted to make a script to draw a line from a point on the screen, that is set by a click, to the current position of the mouse. This works: #Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") $Color=0x94DF08 $Wh=GUICreate("",@DesktopWidth,@DesktopHeight,-1,-1,-1) $LabID=GUICtrlCreateEdit("",0,0,@DesktopWidth-1,@DesktopHeight-1,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) ;~ WinSetTrans($Wh,"",170) GUICtrlSetCursor(-1,3) GUISetState() While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _exit() Exit EndFunc BUT it's useless! I want it to be on the screen and not on a control. So I thought that making the GUI a bit transparent would fix it, but no, it draws BEHIND the GUI (uncomment the WinSetTrans part to see). Why does this happen and how could I fix it? Link to comment Share on other sites More sharing options...
AU3Newbie Posted September 21, 2007 Share Posted September 21, 2007 Yeah, that's my thread I don't wanna open a new thread and since you guys are talking about this, I'll ask my question. I wanted to make a script to draw a line from a point on the screen, that is set by a click, to the current position of the mouse. This works: #Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") $Color=0x94DF08 $Wh=GUICreate("",@DesktopWidth,@DesktopHeight,-1,-1,-1) $LabID=GUICtrlCreateEdit("",0,0,@DesktopWidth-1,@DesktopHeight-1,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) ;~ WinSetTrans($Wh,"",170) GUICtrlSetCursor(-1,3) GUISetState() While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _exit() Exit EndFunc BUT it's useless! I want it to be on the screen and not on a control. So I thought that making the GUI a bit transparent would fix it, but no, it draws BEHIND the GUI (uncomment the WinSetTrans part to see). Why does this happen and how could I fix it? Maybe you can try the code below: #Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") $Color=0x94DF08 ;$Wh=GUICreate("",@DesktopWidth,@DesktopHeight, If _IsPressed(01) Then $LPos = MouseGetPos() Do ;GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 Thank you, but that's what I had originally. The problem with that is that it doesn't refresh the screen so the old lines stay there. Thanks for taking the time though Link to comment Share on other sites More sharing options...
AlmarM Posted September 21, 2007 Share Posted September 21, 2007 Mayby you need to open internet explorer and close it so all lines will disapear ?? I dont know what the parameters of Internet.lnk are so: expandcollapse popup#Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") HotKeySet("{F11}", "_EmptyScreen") $Color=0x94DF08 ;$Wh=GUICreate("",@DesktopWidth,@DesktopHeight, While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do ;GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _EmptyScreen() $empty_screen = ShellExecute("Internet.lnk", "parameter", "open", @SW_MAXIMIZE) Send("!{f4}") EndFunc Func _exit() Exit EndFunc Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 Mayby you need to open internet explorer and close it so all lines will disapear ?? I dont know what the parameters of Internet.lnk are so: expandcollapse popup#Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") HotKeySet("{F11}", "_EmptyScreen") $Color=0x94DF08 ;$Wh=GUICreate("",@DesktopWidth,@DesktopHeight, While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do ;GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _EmptyScreen() $empty_screen = ShellExecute("Internet.lnk", "parameter", "open", @SW_MAXIMIZE) Send("!{f4}") EndFunc Func _exit() Exit EndFunc Mmm no.. that'd make it slow and would cover the screen. And why not use Run and ProcessClose? Link to comment Share on other sites More sharing options...
AU3Newbie Posted September 22, 2007 Share Posted September 22, 2007 tO KEEP THE LINES ON THE SCREEN,wHY NOT USE ARRAY TO REMEMBER THE POINTS WHILE YOU GETTING ANY POS? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 22, 2007 Share Posted September 22, 2007 tO KEEP THE LINES ON THE SCREEN,wHY NOT USE ARRAY TO REMEMBER THE POINTS WHILE YOU GETTING ANY POS?That's not the problem. He wants to move the line or remove the previous line and redraw it in another position. But it's a line of bit-mapped points, not a vector object, so it can't be "moved". Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
AU3Newbie Posted September 22, 2007 Share Posted September 22, 2007 (edited) BTW,It's impossible to move the line,but you can remove the line by redraw it on the same position with a BGcolor. Edited September 22, 2007 by AU3Newbie Link to comment Share on other sites More sharing options...
AlmarM Posted September 22, 2007 Share Posted September 22, 2007 tO KEEP THE LINES ON THE SCREEN,wHY NOT USE ARRAY TO REMEMBER THE POINTS WHILE YOU GETTING ANY POS?Lol... He want to get the lines OF the screen (Screen Refresh) Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Nahuel Posted September 22, 2007 Share Posted September 22, 2007 That's not the problem. He wants to move the line or remove the previous line and redraw it in another position. But it's a line of bit-mapped points, not a vector object, so it can't be "moved". Exactly. I still don't know why the script draws behind my semi-transparent GUI. It works great as long as I don't use WinSetTrans, even if I set it to 255(solid).Could there be an alternate method to draw a line? Link to comment Share on other sites More sharing options...
martin Posted September 22, 2007 Share Posted September 22, 2007 Yeah, that's my thread I don't wanna open a new thread and since you guys are talking about this, I'll ask my question.I wanted to make a script to draw a line from a point on the screen, that is set by a click, to the current position of the mouse. This works:#Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") $Color=0x94DF08 $Wh=GUICreate("",@DesktopWidth,@DesktopHeight,-1,-1,-1) $LabID=GUICtrlCreateEdit("",0,0,@DesktopWidth-1,@DesktopHeight-1,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) ;~ WinSetTrans($Wh,"",170) GUICtrlSetCursor(-1,3) GUISetState() While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _exit() Exit EndFuncBUT it's useless! I want it to be on the screen and not on a control. So I thought that making the GUI a bit transparent would fix it, but no, it draws BEHIND the GUI (uncomment the WinSetTrans part to see).Why does this happen and how could I fix it?Here's a step towards a solution maybeexpandcollapse popup#Include <Misc.au3> #include <Guiconstants.au3> #include <Constants.au3> HotKeySet("{F10}","_exit") $Color=0x94DF08 $Wh=GUICreate("",@DesktopWidth,@DesktopHeight,-1,-1,-1) $LabID=GUICtrlCreateEdit("",0,0,@DesktopWidth-1,@DesktopHeight-1,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) WinSetTrans($Wh,"",170);255) GUICtrlSetCursor(-1,3) $c = WinGetClientSize($wh) $g = GUICtrlCreateGraphic(0,0,$c[0],$c[1]) GUISetState() While 1 If _IsPressed(01) Then $LPos = MouseGetPos() Do GUICtrlSetData($LabID,"") $LPos1 = MouseGetPos() dibujar() Sleep(25) Until NOT _IsPressed(01) EndIf Sleep(50) WEnd Func dibujar() $hand = DllCall("user32.dll","int", "GetDC", "hwnd",GUICtrlGetHandle($g)); 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0 , "int",2, "int", $Color) DllCall("gdi32.dll", "int", "SelectObject", "int", $hand[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hand[0], "int", $LPos[0], "int", $LPos[1], "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hand[0], "int", $LPos1[0], "int", $LPos1[1]) EndFunc Func _exit() Exit EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now