Andrei1398 Posted November 9, 2015 Share Posted November 9, 2015 $ok=MouseGetPos() $ok[0]=$xt[0] $hDC = _WinAPI_GetWindowDC(0) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) $hPen = _WinAPI_CreatePen($PS_SOLID, $iWidth, 0xFFFFFF) While $ok[0]<$disty+$xt[0] $ok[0]= $ok[0]+5 $o = $ok[0]-$xt[0] $y=MouseGetPos() _WinAPI_DrawLine($hDC,$ok[0] ,$y[1]-(($fsiny*$o/$fcosy)-(9.8*$o*$o/(2*10367.3435771*$fcosy*$fcosy))), $ok[0], $y[1]-(($fsiny*$o/$fcosy)-(9.8 * $o*$o/(2*10367.3435771*$fcosy*$fcosy)))-3) WendSo I have this function , it doesn't really matter, it will just draw a graph . But since the screen refreshes constantly, I can't see the lines that I'm drawing for more than one second, therfore I can't see the graph of the function at all. How can I make it stay? Other resources than _WinAi_DrawLine ? I need it to be right on the screen . Not in a GUI so I guess I can't use GDI. Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2015 Share Posted November 9, 2015 Can you show a working code?... Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Andrei1398 Posted November 9, 2015 Author Share Posted November 9, 2015 expandcollapse popup#include <Math.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $x=MouseGetPos() $dist=444 $fDegree = _Degree(ASin($dist*9.8/10367.3435771)) $unghi=(180-$fDegree)/2 $unghi2=$fDegree/2 $fcos =Abs(Cos($unghi*3.14159265/180)) $fsin =Abs(sin($unghi*3.14159265/180)) deseneaza($fcos, $fsin, 20, 2, 0x0000FF, $x, $dist) Func deseneaza($fcosy, $fsiny, $iLength, $iWidth, $iColor, $xt , $disty) Local $hDC, $hPen, $o_Orig $hDC = _WinAPI_GetWindowDC(0) $hPen = _WinAPI_CreatePen($PS_SOLID, $iWidth, $iColor) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) _WinAPI_DrawLine($hDC, MouseGetPos()[0] , MouseGetPos()[1], MouseGetPos()[0]+138*$fcosy, MouseGetPos()[1]-138*$fsiny) ; clear resources _WinAPI_SelectObject($hDC, $o_Orig) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDC) $ok=MouseGetPos() $ok[0]=$xt[0] $hDC = _WinAPI_GetWindowDC(0) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) $hPen = _WinAPI_CreatePen($PS_SOLID, $iWidth, 0xFFFFFF) While $ok[0]<$disty+$xt[0] $ok[0]= $ok[0]+5 $o = $ok[0]-$xt[0] $y=MouseGetPos() _WinAPI_DrawLine($hDC,$ok[0] ,$y[1]-(($fsiny*$o/$fcosy)-(9.8*$o*$o/(2*10367.3435771*$fcosy*$fcosy))), $ok[0], $y[1]-(($fsiny*$o/$fcosy)-(9.8 * $o*$o/(2*10367.3435771*$fcosy*$fcosy)))-3) Wend EndFuncIt's really messy cause it's just a bit of the code . Anyway , try it over a flash / browser or just click one time and the graph just goes away. Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2015 Share Posted November 9, 2015 Store the line on variables. then draw while loop. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Andrei1398 Posted November 9, 2015 Author Share Posted November 9, 2015 I don't get it? I should create an array that stores every single y? And then wouldnt it be the same anyway ? Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2015 Share Posted November 9, 2015 I meant this, expandcollapse popup#include <Math.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $x=MouseGetPos() $dist=444 $fDegree = _Degree(ASin($dist*9.8/10367.3435771)) $unghi=(180-$fDegree)/2 $unghi2=$fDegree/2 $fcos =Abs(Cos($unghi*3.14159265/180)) $fsin =Abs(sin($unghi*3.14159265/180)) deseneaza($fcos, $fsin, 20, 2, 0x0000FF, $x, $dist) Func deseneaza($fcosy, $fsiny, $iLength, $iWidth, $iColor, $xt , $disty) Local $hDC, $hPen, $o_Orig $hDC = _WinAPI_GetWindowDC(0) $hPen = _WinAPI_CreatePen($PS_SOLID, $iWidth, $iColor) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) Local $x1,$y1,$y2,$x2 $x1=MouseGetPos()[0] $y1=MouseGetPos()[1] $x2=MouseGetPos()[0]+138*$fcosy $y2=MouseGetPos()[1]-138*$fsiny $ok=MouseGetPos() $ok[0]=$xt[0] $hDC = _WinAPI_GetWindowDC(0) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) $hPen = _WinAPI_CreatePen($PS_SOLID, $iWidth, 0xFFFFFF) While $ok[0]<$disty+$xt[0] _WinAPI_DrawLine($hDC, $x1, $y1, $x2, $y2) $ok[0]= $ok[0]+5 $o = $ok[0]-$xt[0] $y=MouseGetPos() _WinAPI_DrawLine($hDC,$ok[0] ,$y[1]-(($fsiny*$o/$fcosy)-(9.8*$o*$o/(2*10367.3435771*$fcosy*$fcosy))), $ok[0], $y[1]-(($fsiny*$o/$fcosy)-(9.8 * $o*$o/(2*10367.3435771*$fcosy*$fcosy)))-3) Wend ; clear resources _WinAPI_SelectObject($hDC, $o_Orig) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDC) EndFuncSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut 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