1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. name22

Beiträge von name22

  • Berechner

    • name22
    • 6. Februar 2011 um 17:02

    Bei AutoIt werden die Dezimalstellen einer Zahl nicht mit Kommata sondern mit Punkten gekennzeichnet. Also so:

    [autoit]

    3.141592 ;etc....

    [/autoit]
  • Kann Autoit das?

    • name22
    • 5. Februar 2011 um 19:49

    Und um Classname und Instance der Controls für ControlSend etc. herauszubekommen verwendest du am besten das AutoIt WindowInfoTool im AutoIt Installationsordner ;).

  • Kleinster HD-Kurzfilm

    • name22
    • 5. Februar 2011 um 18:09
    Zitat

    Oder er erfindet einen fetten kompressionsalgorytmus^^


    Das muss aber ein verdammt guter Kompressionsalgorythmus sein 8| ... Spiele und Filme werden dann in Zukunft nicht mehr auf DVD's verkauft sondern auf Disketten. :D

  • [GDI+] Rect auf Bmp Tranzparent setzten

    • name22
    • 5. Februar 2011 um 17:48

    Dann ist das Script aus meinem ersten Beitrag das was du brauchst? Oder funktioniert es nicht wie du es dir vorstellst?
    UEZ Vielleich will er das als eine Art Hintegrundbild in einer GUI. ?( Sozusagen die GDI+ Variante von GUICtrlCreatePic... :S

  • geöffnete textdatei feststellen (*.dat)

    • name22
    • 5. Februar 2011 um 17:46

    Das hier sollte ohne großen Geschwindigkeitsverlust funktionieren.

    Spoiler anzeigen
    [autoit]

    #include "FileListRekursiv.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $von1="v:\pcssw\interface\ish\datain\"
    $von2="w:\pcssw\interface\ish\datain\"
    $in="h:\datain\"
    $file="*.dat"

    [/autoit] [autoit][/autoit] [autoit]

    $aFiles1 = _FileListToRekursiv($von1, $file)
    $aFiles2 = _FileListToRekursiv($von2, $file)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $aFiles1[0]
    ConsoleWrite($i & ". - " & $aFiles1[$i] & " : " & FileMove($von1 & $aFiles1[$i], $in & $aFiles1[$i], 1) & @CRLF)
    Next
    For $i = 1 To $aFiles2[0]
    ConsoleWrite($i & ". - " & $aFiles2[$i] & " : " & FileMove($von1 & $aFiles2[$i], $in & $aFiles2[$i], 1) & @CRLF)
    Next

    [/autoit]


    Die Datei im Anhang muss noch ins selbe Verzeichnis wie das Script.

    Dateien

    FileListRekursiv.au3 3,52 kB – 245 Downloads
  • geöffnete textdatei feststellen (*.dat)

    • name22
    • 5. Februar 2011 um 17:12

    Kannst du vielleicht den Teil des Scriptes zeigen, der für das verschieben verantwortlich ist? Sonst können wir nur raten woran es liegt...

  • UDF: ToolTips für Slider Controls

    • name22
    • 5. Februar 2011 um 17:06

    Update: Habe hellboy3's GUIGetCursorInfo Problem beseitigt (siehe 1. Beitrag) ;).

  • [GDI+] Rect auf Bmp Tranzparent setzten

    • name22
    • 5. Februar 2011 um 16:17

    Du kannst das mit ein paar Funktionen aus der GDIP.au3 erreichen. Das dürfte um einiges schneller sein, als die Pixel einzeln transparent zu setzen.

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $iX_Clip = 50
    $iY_Clip = 50
    $iWidth_Clip = 200
    $iHeight_Clip = 200

    [/autoit] [autoit][/autoit] [autoit]

    $sPathImage = FileOpenDialog("Bild öffnen", @ScriptDir, "Bilder (*.jpg;*.bmp;*.png)")
    If @error Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hImage = _GDIPlus_ImageLoadFromFile($sPathImage)
    $iWidth = _GDIPlus_ImageGetWidth($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage)

    [/autoit] [autoit][/autoit] [autoit]

    $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;Erzeugt eine neue leere Bitmap
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsSetClipRect($hGraphic, $iX_Clip, $iY_Clip, $iWidth_Clip, $iHeight_Clip, 3) ;Setzt eine Begrenzung für Zeichenfläche.

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iWidth, $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Test.png")

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_BitmapCreateFromScan0
    ; Description ...: Creates a Bitmap object based on an array of bytes along with size and format information
    ; Syntax.........: _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight[, $iStride = 0[, $iPixelFormat = 0x0026200A[, $pScan0 = 0]]])
    ; Parameters ....: $iWidth - The bitmap width, in pixels
    ; $iHeight - The bitmap height, in pixels
    ; $iStride - Integer that specifies the byte offset between the beginning of one scan line and the next. This
    ; +is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel)
    ; +multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four
    ; $iPixelFormat - Specifies the format of the pixel data. Can be one of the following:
    ; |$GDIP_PXF01INDEXED - 1 bpp, indexed
    ; |$GDIP_PXF04INDEXED - 4 bpp, indexed
    ; |$GDIP_PXF08INDEXED - 8 bpp, indexed
    ; |$GDIP_PXF16GRAYSCALE - 16 bpp, grayscale
    ; |$GDIP_PXF16RGB555 - 16 bpp; 5 bits for each RGB
    ; |$GDIP_PXF16RGB565 - 16 bpp; 5 bits red, 6 bits green, and 5 bits blue
    ; |$GDIP_PXF16ARGB1555 - 16 bpp; 1 bit for alpha and 5 bits for each RGB component
    ; |$GDIP_PXF24RGB - 24 bpp; 8 bits for each RGB
    ; |$GDIP_PXF32RGB - 32 bpp; 8 bits for each RGB. No alpha.
    ; |$GDIP_PXF32ARGB - 32 bpp; 8 bits for each RGB and alpha
    ; |$GDIP_PXF32PARGB - 32 bpp; 8 bits for each RGB and alpha, pre-mulitiplied
    ; $pScan0 - Pointer to an array of bytes that contains the pixel data. The caller is responsible for
    ; +allocating and freeing the block of memory pointed to by this parameter.
    ; Return values .: Success - Returns a handle to a new Bitmap object
    ; Failure - 0 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: After you are done with the object, call _GDIPlus_ImageDispose to release the object resources
    ; Related .......: _GDIPlus_ImageDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateBitmapFromScan0
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_BitmapCreateFromScan0

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetClipRect
    ; Description ...: Updates the clipping region of a Graphics object to a region that is the combination of itself and a rectangle
    ; Syntax.........: _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight[, $iCombineMode = 0])
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $nX - X coordinate of the upper-left corner of the rectangle
    ; $nY - Y coordinate of the upper-left corner of the rectangle
    ; $nWidth - Width of the rectangle
    ; $nHeight - Height of the rectangle
    ; $iCombineMode - Regions combination mode:
    ; |0 - The existing region is replaced by the new region
    ; |1 - The existing region is replaced by the intersection of itself and the new region
    ; |2 - The existing region is replaced by the union of itself and the new region
    ; |3 - The existing region is replaced by the result of performing an XOR on the two regions
    ; |4 - The existing region is replaced by the portion of itself that is outside of the new region
    ; |5 - The existing region is replaced by the portion of the new region that is outside of the existing region
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: None
    ; Link ..........; @@MsdnLink@@ GdipSetClipRect
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $iCombineMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetClipRect", "hwnd", $hGraphics, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iCombineMode)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetClipRect

    [/autoit]
  • Punkte auf einem Kreis ermitteln

    • name22
    • 5. Februar 2011 um 01:59
    Zitat

    hab eine Lösung für mein Problem gefunden...


    Poste es doch ;). Vielleicht hat irgendwann jemand hier im Forum das selbe Problem...

  • Punkte auf einem Kreis ermitteln

    • name22
    • 5. Februar 2011 um 01:37

    Mit Vektoren geht das z.B. so.

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Pi_Div_180 = ACos(-1) / 180

    [/autoit] [autoit][/autoit] [autoit]

    $iLength = 10
    $iStartAngle = 0
    $iStepAngle = 45
    $iSteps = 8

    [/autoit] [autoit][/autoit] [autoit]

    Global $aVector_Test[2] = [0, $iLength * -1], $aResults[$iSteps + 1][2] = [[$iSteps]]

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $aResults[0][0]
    $aVector_Result = _Vector_RotateOnZAxis($aVector_Test, $iStartAngle + ($i - 1) * $iStepAngle)
    $aResults[$i][0] = $aVector_Result[0]
    $aResults[$i][1] = $aVector_Result[1]
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _ArrayDisplay($aResults)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Vector_RotateOnZAxis($aVector_Rotate, $iDegree)
    Local $aVector_Return[2]

    [/autoit] [autoit][/autoit] [autoit]

    $aVector_Return[0] = $aVector_Rotate[0] * _Cos($iDegree) - $aVector_Rotate[1] * _Sin($iDegree)
    $aVector_Return[1] = $aVector_Rotate[1] * _Cos($iDegree) + $aVector_Rotate[0] * _Sin($iDegree)

    [/autoit] [autoit][/autoit] [autoit]

    Return $aVector_Return
    EndFunc ;==>_Vector_RotateOnZAxis

    [/autoit] [autoit][/autoit] [autoit]

    Func _Cos($nValue)
    Return Cos($nValue * $Pi_Div_180)
    EndFunc ;==>_Cos

    [/autoit] [autoit][/autoit] [autoit]

    Func _Sin($nValue)
    Return Sin($nValue * $Pi_Div_180)
    EndFunc ;==>_Sin

    [/autoit]
  • hGraphics oder hBitmap von hDC - mit _WinAPI_DrawIconEx direkt auf Gdi+ Kontext

    • name22
    • 4. Februar 2011 um 23:47

    Du kannst auch einfach eine Bitmap aus dem "HICON" erstellen.

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <Constants.au3>
    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $sIconPath = FileOpenDialog("Icon öffnen", @ScriptDir, "Icon Files (*.ico)")
    If @error Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Icon Test", 200, 200)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)

    [/autoit] [autoit][/autoit] [autoit]

    $hIcon = _WinAPI_LoadImage(0, $sIconPath, $IMAGE_ICON, 0, 0, $LR_LOADFROMFILE)
    $hBitmap_Icon = _GDIPlus_BitmapCreateFromHICON($hIcon)
    _WinAPI_DestroyIcon($hIcon)

    [/autoit] [autoit][/autoit] [autoit]

    $iWidth = _GDIPlus_ImageGetWidth($hBitmap_Icon)
    $iHeight = _GDIPlus_ImageGetHeight($hBitmap_Icon)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap_Icon, 100 - $iWidth / 2, 100 - $iHeight / 2, $iWidth, $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_BitmapDispose($hBitmap_Icon)
    _GDIPlus_Shutdown()

    [/autoit] [autoit][/autoit] [autoit]

    While GUIGetMsg() <> -3
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_BitmapCreateFromHICON
    ; Description ...: Creates a Bitmap object based on an icon
    ; Syntax.........: _GDIPlus_BitmapCreateFromHICON($hIcon)
    ; Parameters ....: $hIcon - Handle to an icon
    ; Return values .: Success - Returns a handle to a new Bitmap object
    ; Failure - 0 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: After you are done with the object, call _GDIPlus_ImageDispose to release the object resources
    ; Related .......: _GDIPlus_ImageDispose, _WinAPI_LoadImage, _WinAPI_LoadIcon
    ; Link ..........; @@MsdnLink@@ GdipCreateBitmapFromHICON
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _GDIPlus_BitmapCreateFromHICON($hIcon)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromHICON", "hwnd", $hIcon, "int*", 0)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_BitmapCreateFromHICON

    [/autoit]
  • Input-Feld & Text Konvertieren

    • name22
    • 4. Februar 2011 um 20:12

    Hmm Modulo vielleicht noch. Ansonsten wären das die wichtigsten Funktionen. Alles andere mache ich entweder auf dem Papier oder mit einem Script. ;)

  • Input-Feld & Text Konvertieren

    • name22
    • 4. Februar 2011 um 19:44

    (Arcus)Sinus, (Arcus)Kosinus, (Arcus)Tangens, Quadratwurzel, Konstanten wie Pi oder eulersche Zahl.

  • Input-Feld & Text Konvertieren

    • name22
    • 4. Februar 2011 um 19:17

    So würde es gehen...

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>
    #include <GUIEdit.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Test", 200, 60)
    $cInput = GUICtrlCreateInput("AutoIt", 5, 5, 190, 20)
    $cButton = GUICtrlCreateButton("Test", 5, 30, 190, 25)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
    $bFocus = False

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    If $bFocus Then
    ControlFocus($hWnd, "", $cInput)
    _GUICtrlEdit_SetSel($cInput, 0, -1)
    $bFocus = False
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)
    If $WParam = 0x01000003 And $LParam = ControlGetHandle($hWnd, "", $cInput) Then $bFocus = True
    EndFunc

    [/autoit]


    Wobei ich nicht weiß, warum ein direktes aufrufen von SetSel innerhalb von _WM_COMMAND nicht funktioniert. :S

  • Input-Feld & Text Konvertieren

    • name22
    • 4. Februar 2011 um 18:48

    Allerdings solltest du dann den String überprüfen z.B. mit StringRegExp.
    Ansonsten könnte man auch MsgBox o.Ä. eingeben und es würde ausgeführt werden ;).

    [autoit]

    $sTerm = InputBox("Calculate", "Term:")
    $sTerm = StringRegExpReplace($sTerm, '[^\d\+\-/\*\(\)\^]', "")
    MsgBox(64, "Result", Execute($sTerm))

    [/autoit]
  • Hilfe bei einem RegEx

    • name22
    • 4. Februar 2011 um 15:59

    So würde es gehen...

    [autoit]

    $sTest = '<span style="text-align: left;" class="z" id="ticker1"> test34:25</span>'
    $sPattern = '<span style="text-align: left;" class="z" id="ticker1"> ((?:\d|:)+?)</span>'

    [/autoit][autoit][/autoit][autoit]

    $aResult = StringRegExp($sTest, $sPattern, 3)
    MsgBox(64, "Result", $aResult[0])

    [/autoit]


    Das ist natürlich eine von unzähligen Lösungen. Vielleicht kennt ja jemand auch eine bessere/schnellere...

  • Happy Birthday, Andy

    • name22
    • 4. Februar 2011 um 12:31

    Alles gute zum Geburtstag Andy! :party:

  • Linie begrenzen m

    • name22
    • 4. Februar 2011 um 12:25

    Ich habe mal ein Beispiel gemacht....

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Pi_Div_180 = ACos(-1) / 180
    $vU32Dll = DllOpen("User32.dll")

    [/autoit] [autoit][/autoit] [autoit]

    $iGUIColorBG = 0xFFFFFFFF
    $iGUIWidth = 400
    $iGUIHeight = 400
    $FPS = 40

    [/autoit] [autoit][/autoit] [autoit]

    $iRadiusButton = 60
    $iRadiusPoint = 40

    [/autoit] [autoit][/autoit] [autoit]

    $vButton_Middle = _Vector_Create(200, 200)
    $vButton_Point = _Vector_Create(200, 160)

    [/autoit] [autoit][/autoit] [autoit]

    $vNegativeYAxis = _Vector_Create(0, -1)
    $iAngle = 0

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)

    [/autoit] [autoit][/autoit] [autoit]

    $hFormat_Text = _GDIPlus_StringFormatCreate()
    $hFamily_Text = _GDIPlus_FontFamilyCreate("Arial")
    $hFont_Text = _GDIPlus_FontCreate($hFamily_Text, 15)

    [/autoit] [autoit][/autoit] [autoit]

    $hPen_Button = _GDIPlus_PenCreate(0xFF000000, 2)
    $hBrush_Point = _GDIPlus_BrushCreateSolid(0xFF000000)
    $hBrush_Text = _GDIPlus_BrushCreateSolid(0xFF0000FF)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    AdlibRegister("_DrawFrame", Round(1000 / $FPS))

    [/autoit] [autoit][/autoit] [autoit]

    $bMouseClick = False

    [/autoit] [autoit][/autoit] [autoit]

    While Sleep(1000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _DrawFrame()
    If _IsPressed("01", $vU32Dll) Then
    $aCursorInfo = GUIGetCursorInfo($hWnd)
    If $bMouseClick Or _PointIsInCircle($aCursorInfo[0], $aCursorInfo[1], DllStructGetData($vButton_Middle, "X"), DllStructGetData($vButton_Middle, "Y"), $iRadiusButton) Then
    $vDirection = _Vector_Normalize(_Vector_Create($aCursorInfo[0] - DllStructGetData($vButton_Middle, "X"), $aCursorInfo[1] - DllStructGetData($vButton_Middle, "Y")))

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vButton_Point, "X", DllStructGetData($vButton_Middle, "X") + DllStructGetData($vDirection, "X") * $iRadiusPoint)
    DllStructSetData($vButton_Point, "Y", DllStructGetData($vButton_Middle, "Y") + DllStructGetData($vDirection, "Y") * $iRadiusPoint)

    [/autoit] [autoit][/autoit] [autoit]

    $iAngle = _Vector_GetAngle($vDirection, $vNegativeYAxis)
    If DllStructGetData($vDirection, "X") < 0 Then $iAngle = 360 - $iAngle

    [/autoit] [autoit][/autoit] [autoit]

    $bMouseClick = True
    EndIf
    Else
    If $bMouseClick Then $bMouseClick = False
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $aLayout_Text = _GDIPlus_GraphicsMeasureString($hBuffer, Round($iAngle, 2), $hFont_Text, _GDIPlus_RectFCreate(0, 270), $hFormat_Text)
    DllStructSetData($aLayout_Text[0], "X", 200 - DllStructGetData($aLayout_Text[0], "Width") / 2)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsClear($hBuffer, $iGUIColorBG)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, Round($iAngle, 2), $hFont_Text, $aLayout_Text[0], $hFormat_Text, $hBrush_Text)
    _GDIPlus_GraphicsDrawEllipse($hBuffer, DllStructGetData($vButton_Middle, "X") - $iRadiusButton, DllStructGetData($vButton_Middle, "Y") - $iRadiusButton, $iRadiusButton * 2, $iRadiusButton * 2, $hPen_Button)
    _GDIPlus_GraphicsFillEllipse($hBuffer, DllStructGetData($vButton_Point, "X") - 3, DllStructGetData($vButton_Point, "Y") - 3, 6, 6, $hBrush_Point)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
    EndFunc ;==>_DrawFrame

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_PenDispose($hPen_Button)
    _GDIPlus_BrushDispose($hBrush_Point)
    _GDIPlus_BrushDispose($hBrush_Text)
    _GDIPlus_StringFormatDispose($hFormat_Text)
    _GDIPlus_FontFamilyDispose($hFamily_Text)
    _GDIPlus_FontDispose($hFont_Text)
    _GDIPlus_Shutdown()
    DllClose($vU32Dll)
    Exit
    EndFunc ;==>_Exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Vector_GetAngle($vVector1, $vVector2)
    $nScalarProduct = DllStructGetData($vVector1, "X") * DllStructGetData($vVector2, "X") + DllStructGetData($vVector1, "Y") * DllStructGetData($vVector2, "Y")
    $nVector1_Length = Sqrt(DllStructGetData($vVector1, "X") ^ 2 + DllStructGetData($vVector1, "Y") ^ 2)
    $nVector2_Length = Sqrt(DllStructGetData($vVector2, "X") ^ 2 + DllStructGetData($vVector2, "Y") ^ 2)

    [/autoit] [autoit][/autoit] [autoit]

    Return ACos($nScalarProduct / ($nVector1_Length * $nVector2_Length)) / $Pi_Div_180
    EndFunc ;==>_Vector_GetAngle

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_Normalize($vNorm)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    $nVectorLength = Sqrt(DllStructGetData($vNorm, "X") ^ 2 + DllStructGetData($vNorm, "Y") ^ 2)
    If $nVectorLength Then
    DllStructSetData($vReturn, "X", DllStructGetData($vNorm, "X") / $nVectorLength)
    DllStructSetData($vReturn, "Y", DllStructGetData($vNorm, "Y") / $nVectorLength)
    Else
    DllStructSetData($vReturn, "X", 0)
    DllStructSetData($vReturn, "Y", 0)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_Normalize

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_RotateOnZAxis($vRotate, $iDegree)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vReturn, "X", DllStructGetData($vRotate, "X") * _Cos($iDegree) - DllStructGetData($vRotate, "Y") * _Sin($iDegree))
    DllStructSetData($vReturn, "Y", DllStructGetData($vRotate, "Y") * _Cos($iDegree) + DllStructGetData($vRotate, "X") * _Sin($iDegree))

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_RotateOnZAxis

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_ProjectVector($vProject1, $vProject2)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    $ScalarProduct = DllStructGetData($vProject1, "X") * DllStructGetData($vProject2, "X") + DllStructGetData($vProject1, "Y") * DllStructGetData($vProject2, "Y")
    DllStructSetData($vReturn, "X", ($ScalarProduct / (DllStructGetData($vProject1, "X") * DllStructGetData($vProject1, "Y") + DllStructGetData($vProject2, "X") * DllStructGetData($vProject1, "Y"))) * DllStructGetData($vProject2, "X"))
    DllStructSetData($vReturn, "Y", ($ScalarProduct / (DllStructGetData($vProject1, "X") * DllStructGetData($vProject1, "Y") + DllStructGetData($vProject2, "X") * DllStructGetData($vProject1, "Y"))) * DllStructGetData($vProject2, "Y"))

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_ProjectVector

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_GetLength($vLength)
    Return Sqrt(DllStructGetData($vLength, "X") ^ 2 + DllStructGetData($vLength, "Y") ^ 2)
    EndFunc ;==>_Vector_GetLength

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_Create($nXValue, $nYValue)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vReturn, "X", $nXValue)
    DllStructSetData($vReturn, "Y", $nYValue)

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_Create

    [/autoit] [autoit][/autoit] [autoit]

    Func _Cos($nValue)
    Return Cos($nValue * $Pi_Div_180)
    EndFunc ;==>_Cos

    [/autoit] [autoit][/autoit] [autoit]

    Func _Sin($nValue)
    Return Sin($nValue * $Pi_Div_180)
    EndFunc ;==>_Sin

    [/autoit] [autoit][/autoit] [autoit]

    Func _Tan($nValue)
    Return Tan($nValue * $Pi_Div_180)
    EndFunc ;==>_Tan

    [/autoit] [autoit][/autoit] [autoit]

    Func _PointIsInCircle($iX_Point, $iY_Point, $iX_Circle, $iY_Circle, $iRadius_Circle)
    $iDistPoints = _GetPointsDistance($iX_Point, $iY_Point, $iX_Circle, $iY_Circle)
    If ($iRadius_Circle > 0 And $iDistPoints < $iRadius_Circle) Or ($iRadius_Circle < 0 And $iDistPoints > $iRadius_Circle) Or $iDistPoints = 0 Then Return 1
    Return 0
    EndFunc ;==>_PointIsInCircle

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetPointsDistance($iPointX1, $iPointY1, $iPointX2, $iPointY2)
    Return Sqrt(($iPointX1 - $iPointX2) ^ 2 + ($iPointY1 - $iPointY2) ^ 2)
    EndFunc ;==>_GetPointsDistance

    [/autoit]
  • GUID erzeugen

    • name22
    • 3. Februar 2011 um 15:36

    Man lernt nie aus, danke autoBert ;).

  • Zeicheneditor

    • name22
    • 3. Februar 2011 um 15:14
    Zitat

    Ich dachte, dass er GDI+ bereits benutzt hat?


    Und dann kommt sowas dabei raus?! 8| Er braucht eindeutig ein (besseres) GDI+ Tutorial...

    Zitat

    und wie geht das?

    [autoit]

    GUIGetCursorInfo

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™