Sign in to follow this  
Followers 0
pepsip77

Drawing on screen

3 posts in this topic

Hello, i've found this code and i thought if it would be possible to use it somwhere not on desktop only?

#include <ButtonConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <GUIConstants.au3>
#include <GDIplus.au3>
SRandom(@AutoItPID)
WinMinimizeAll ()
HotKeySet("{ESC}", "exit")
Dim $x, $y, $Color, $Width
While "Drawing Pixel"
$pixel2 = PixelSearch(0,0,1000,768, 0x000000)  
   If IsArray($pixel2) = True Then
   $Width = 5
    $x =$pixel2[0]   
    $y = $pixel2[1]
    $Color = 0xFFA9EC
    drawapixel()    
   EndIf  
WEnd
Func drawapixel()
    $hnd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    $Pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $Width, "int", $Color)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $hnd[0], "int", $Pen[0])
    DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hnd[0], "int", $x, "int", $y, "int", 0)
    DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hnd[0], "int", $x, "int", $y)
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hnd[0])
EndFunc  
Func exit()
    WinMinimizeAllUndo ( )
    Exit
EndFunc

Share this post


Link to post
Share on other sites



lookin interesting, Although, "exit is not a valid function name, i'd suggest switching it to end to avoid compiler confusion.

as far as your origional question, i have no idea, can wait to see how this turns out.

Share this post


Link to post
Share on other sites

lock this topic. found what i wanted :oops:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0