uzi17 Posted January 10, 2009 Share Posted January 10, 2009 i want to make something where it will draw a coloured line horizontal, and verticle on my screen, acting like a cross hair i can use in a first person shooter game. the sniper does not have a crosshair when unscoped so i thought having the lines would help. can auto it do this? if so can someone lead me into the right direction. thanks Link to comment Share on other sites More sharing options...
FireFox Posted January 10, 2009 Share Posted January 10, 2009 @uzi17 already asked so many times ! please make search on forum ! Cheers, FireFox. Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 (edited) i want to make something where it will draw a coloured line horizontal, and verticle on my screen, acting like a cross hair i can use in a first person shooter game. the sniper does not have a crosshair when unscoped so i thought having the lines would help. can auto it do this? if so can someone lead me into the right direction. thanks Try this: HotKeySet("{ESC}","Quit"); Press ESC to quit Global $CENTER_X = Int(@DesktopWidth/2) Global $CENTER_Y = Int(@DesktopHeight/2) $REFRESH = InputBox("DrawLines","Refresh time","5") While 1 DrawLines() Sleep(GUICtrlRead($REFRESH*1000)) WEnd Func DrawLines() $DC = DllCall ("user32.dll", "int", "GetDC", "hwnd", "") For $INDEX = $CENTER_X - 25 To $CENTER_X + 25 DrawPixel($DC,$INDEX,$CENTER_Y,0x00FF00) Next For $INDEX = $CENTER_Y - 25 To $CENTER_Y + 25 DrawPixel($DC,$CENTER_X,$INDEX,0x00FF00) Next EndFunc Func DrawPixel($hDC,$X,$Y,$COLOR) DllCall ("gdi32.dll", "long", "SetPixel", "long", $hDC[0], "long", $X, "long", $Y, "long", $COLOR) EndFunc Func Quit() Exit EndFunc Edited January 10, 2009 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
FireFox Posted January 10, 2009 Share Posted January 10, 2009 @Andreik ...this men will continue to ask questions without search on forum because you give him the answer Cheers, FireFox. Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 @Andreik...this men will continue to ask questions without search on forum because you give him the answer Cheers, FireFox.Although many threads seem to be identical but you can not get the same thing to them. Maybe this question it was asked before, but do not want to hijack other threads with his questions.Regards,Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
monoceres Posted January 10, 2009 Share Posted January 10, 2009 @Andreik, you've got a memory leak in your code, you need to use ReleaseDC after you're done with a device context. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted January 10, 2009 Share Posted January 10, 2009 @Andreik As I saw, he wanna draw pixel function. after have found the function, if he want more information about it he has just to ask his question with the function example Cheers, FireFox. Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 @Andreik, you've got a memory leak in your code, you need to use ReleaseDC after you're done with a device context.Thanks monoceres. I didn't saw. I'll fix it. When the words fail... music speaks. 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