Jump to content

Draw On-Screen


Recommended Posts

hiyas, I've seen DLL's (or something) used to draw colored lines on the screen, can someone show me how to do this? Thanks, I've never done this so... :rolleyes:

EDIT: While im at it, can DLL's be used in the same way to write words on screen?

Thanks,

Method Zero

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

hiyas, I've seen DLL's (or something) used to draw colored lines on the screen, can someone show me how to do this? Thanks, I've never done this so... :rolleyes:

Thanks,

Method Zero

Lokster screensavers are good examples.

Heres the latest one

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

uhh, I wont lie to you, im really confused in that script, but I have to gess its somewhere near:

$pen = DllCall($GDI32, "hwnd", "CreatePen", "int", "0", "int", $particles[$i][0], "int", $particles[$i][1])

XD a single DOT would be sufficient... but im still lost XD

Thanks for the reply

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Maybe.....

#include <misc.au3>
#include <A3LWinAPI.au3>
Dim $Mpos_1 = "", $Mpos_1A = "", $Mpos_2 = "", $Mpos_2A = "", $line = ""
$LineColor = 0x00ff00; color BGR
$LineWidth = 5

HotKeySet( "{ESC}", "Get_Exit")

While 1
   ;Sleep(1)
    Global $hnd = _API_GetDesktopWindow()
    If _IsPressed(1) Then
        While _IsPressed(1)
            Local $firstPos = MouseGetPos()
            DrawBox($firstPos[0],$firstPos[1],$firstPos[0]+1,$firstPos[1]+1)
        WEnd
    EndIf
_API_RedrawWindow($hnd,Default,Default,$RDW_ERASENOW)
WEnd

Func Get_pos_one()
    GUICtrlDelete($line)
    $Ms_In = MouseGetPos()
    $Mpos_1 = $Ms_In[0]
    $Mpos_2 = $Ms_In[1]
    
EndFunc ;==>Get_pos_one

Func Get_pos_two()
    GUICtrlDelete($line)
    $Ms_In2 = MouseGetPos()
    $Mpos_1A = $Ms_In2[0]
    $Mpos_2A = $Ms_In2[1]
    
EndFunc ;==>Get_pos_two

Func DrawBox($firstPos_x, $firstPos_y, $secondPos_x, $secondPos_y)
    
    If $firstPos_x = "" Or $secondPos_x = "" Then
        Return
    EndIf

    $hd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $LineWidth, "int", $LineColor)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $hd[0], "int", $pen[0])
    DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hd[0], "int", $firstPos_x, "int", $firstPos_y, "int", 0)
    DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hd[0], "int", $secondPos_x, "int", $secondPos_y)
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hd[0])
    
EndFunc ;==>Get_drawing

Func Get_Exit()
    Exit
EndFunc ;==>Get_Exit

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

thanks, this is perfect!

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...