Jump to content

Tekk

Active Members
  • Posts

    78
  • Joined

Community Answers

  1. Tekk's post in Event when window becomes inactive was marked as the answer   
    https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-activate
  2. Tekk's post in Taskbar item blinking is lagged/slow was marked as the answer   
    Check the help file again.  8 should be a 10.  It doesn't know what you want it to flash, the window caption or the taskbar button.
  3. Tekk's post in GUICtrlCreateUpdown() Weird behavior (decimal numbers) was marked as the answer   
    Try this:
    #include <UpDownConstants.au3> GUICtrlCreateUpdown($input1, $UDS_NOTHOUSANDS)
  4. Tekk's post in mysterious $i & $h was marked as the answer   
    See here.
  5. Tekk's post in DllCall problem was marked as the answer   
    It's "Kernel32.dll", also it should be "MoveFileW" judging by the data type you are passing in.  http://goo.gl/5bHIXE
  6. Tekk's post in $CmdLineRaw not getting populated/empty? was marked as the answer   
    Please try this.  It works for me.
    package test; import java.io.IOException; public class test { public static void main(String[] args) throws IOException, InterruptedException { String[] cmd = new String[4]; cmd[0] = "C:/Users/"Your Username"/Desktop/test.exe"; cmd[1] = "test"; cmd[2] = "test1"; cmd[3] = "test2"; Runtime.getRuntime().exec(cmd, null); } }
  7. Tekk's post in Translate problem to autoit was marked as the answer   
    If you simply want to find out if a point lies within a circle you could measure the distance from the circle center to the point.  If the distance to the point is less than the radius of the circle then the point is within the circle.
    Func GetDistance($fX1, $fY1, $fX2, $fY2) Return Sqrt(($fX1 - $fX2) ^ 2 + ($fY1 - $fY2) ^ 2) EndFunc If the point is within the circle you could then get the angle from the circle center to the point.  Knowing the distance and the angle would tell you exactly which part of the circle the pixel is in.
    Func GetAngle($fX1, $fY1, $fX2, $fY2) Return ((($fY2 <= $fY1) * 180) - (ATan(($fX1 - $fX2) / ($fY1 - $fY2)) * 57.295779) + 90) EndFunc As far as getting all the pixel coordinates of a circle, I can’t think of an efficient way to do it. This would work but is very slow...
    Func GetCircleCoordinates($fCircCentX, $fCircCentY, $fCircRadius) Local $aCoordinates[Abs(($fCircRadius * 2) ^ 2) + 1][2] For $iY = Abs($fCircCentY - $fCircRadius) To Abs($fCircCentY + $fCircRadius) For $iX = Abs($fCircCentX - $fCircRadius) To Abs($fCircCentX + $fCircRadius) If (GetDistance($fCircCentX, $fCircCentY, $iX, $iY) < $fCircRadius) Then $aCoordinates[0][0] += 1 $aCoordinates[$aCoordinates[0][0]][0] = $iX $aCoordinates[$aCoordinates[0][0]][1] = $iY EndIf Next Next ReDim $aCoordinates[$aCoordinates[0][0] + 1][2] Return $aCoordinates EndFunc
×
×
  • Create New...