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. UEZ

Beiträge von UEZ

  • IP in Binär umrechnen und umgekehrt

    • UEZ
    • 28. Februar 2012 um 22:52

    Habe Post#7 aktualisiert!

    Gruß,
    UEZ

  • IP in Binär umrechnen und umgekehrt

    • UEZ
    • 28. Februar 2012 um 21:21

    Hier meine Version:

    Spoiler anzeigen
    [autoit]


    #include-once
    #include <String.au3>

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

    Global $ip = "32.64.0.3"
    MsgBox(0, "IP Address to Binary String", "IP = " & @TAB & $ip & @LF & "Binary = " & @TAB & IPv4toBIN($ip))

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

    Global $sBin = "10000001 111000 1010 00001111"
    MsgBox(0, "Binary String to IP Address", "Binary = " & @TAB & $sBin & @LF & "IP = " & @TAB & BINtoIPv4($sBin))

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

    ;===============================================================================
    ; Function Name: IPv4toBIN
    ; Description: Converts an IP v4 string to a binary string format
    ; Parameter(s): $sIP: the ip v4 address with a format "a.b.c.d"
    ; $bLen8
    ; True: output binary string length is always 8 digits
    ; False: output is truncated to minimum length
    ; Requirement(s): String.au3
    ; Return Value(s): binary string format of all octets from the ip address with a format "a b c d"
    ;Error Codes: 1: ip adress not in appropiate format
    ; 2: invalid ip token size -> must be between 0 and 255
    ; Author(s): UEZ
    ;Version: v0.99 Build 2012-02-28
    ;===============================================================================
    Func IPv4toBIN($sIP, $bLen8 = True)
    Local $aIPTokens = StringRegExp($sIP, "(\d+)\.(\d+)\.(\d+)\.(\d+)", 3)
    If @error Then Return SetError(1, 0, -1)
    Local $bin, $sBin, $i
    For $i = 0 To 3
    If Int($aIPTokens[$i]) Then
    If $aIPTokens[$i] > 255 Then Return SetError(2, 0, -1)
    While $aIPTokens[$i] > 0
    $bin &= Mod($aIPTokens[$i], 2)
    $aIPTokens[$i] = Floor($aIPTokens[$i] / 2)
    WEnd
    Else
    If $bLen8 Then
    $bin = "00000000"
    Else
    $bin = "0"
    EndIf
    EndIf
    If $bLen8 Then
    $sBin &= StringFormat("%0.8i", _StringReverse($bin)) & " "
    Else
    $sBin &= _StringReverse($bin) & " "
    EndIf
    $bin = ""
    Next
    Return StringMid($sBin, 1, StringLen($sBin) - 1)
    EndFunc

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

    ;===============================================================================
    ; Function Name: BINtoIPv4
    ; Description: Converts a binary string format to an IP v4 string
    ; Parameter(s): $sBin: the binary string with format "a b c d"
    ; Requirement(s): String.au3
    ; Return Value(s): the ip address in format "a.b.c.d"
    ;Error Codes: 1: string is not a binary string
    ; 2: too much tokens
    ; Author(s): UEZ
    ;Version: v0.99 Build 2012-02-28
    ;===============================================================================
    Func BINtoIPv4($sBin) ;coded by UEZ 2012
    Local $aIPTokens = StringRegExp($sBin, "[01]{1,8}", 3)
    If @error Then Return SetError(1, 0, -1)
    If UBound($aIPTokens) <> 4 Then Return SetError(2, 0, -1)
    Local $sIP, $int, $x, $y, $i = 1, $aTmp
    For $y = 0 To 3
    $aTmp = StringSplit(_StringReverse($aIPTokens[$y]), "")
    For $x = 1 To UBound($aTmp) - 1
    $int += $aTmp[$x] * $i
    $i *= 2
    Next
    $sIP &= $int & "."
    $int = 0
    $i = 1
    $aTmp = 0
    Next
    Return StringMid($sIP, 1, StringLen($sIP) - 1)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • GDI Plus

    • UEZ
    • 25. Februar 2012 um 16:56

    Meinst du so was?

    Spoiler anzeigen
    [autoit]


    #include <GuiConstants.au3>
    #include <GdiPlus.au3>

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

    OnAutoItExitRegister("_end")

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

    $Gui = GUICreate("Beispiel", 500, 600)
    $iLabel = GUICtrlCreateLabel("", 11, 10, 188, 23)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

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

    _GDIPlus_Startup()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Gui)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Backgrounds\gui_background5.jpg")
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0)
    $hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Backgrounds\gui_background_label.jpg")
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    _GDIPlus_StringFormatCreate(0x0001,0)

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

    $c = 0

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _end()
    Exit
    EndSwitch
    $aMPos = GUIGetCursorInfo($Gui)
    If IsArray($aMPos) Then
    If $aMPos[4] = $iLabel Then
    If $c Then
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    _GDIPlus_GraphicsDrawString($hGraphics,"Es wurde 'A' 10 mal gedrückt.", 15,12)
    $c = 0
    EndIf
    Else
    If Not $c Then
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    $c = 1
    EndIf
    EndIf
    EndIf
    WEnd

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

    Func _end()
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hImage2)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Bild bearbeiten

    • UEZ
    • 24. Februar 2012 um 12:59

    Warum das Rad neu erfinden?

    In der GDIp.au3 ist bereits die Funktion _GDIPlus_GraphicsSetInterpolationMode() implementiert, die beim Scalen eines Bildes 7 verschiedene Interploationsmodis mitbringt.

    Spoiler anzeigen
    [autoit]


    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetInterpolationMode
    ; Description ...: Sets the interpolation mode of a Graphics object
    ; Syntax.........: _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $iInterpolationMode - Interpolation mode:
    ; |0 - Default interpolation mode
    ; |1 - Low-quality mode
    ; |2 - High-quality mode
    ; |3 - Bilinear interpolation. No prefiltering is done
    ; |4 - Bicubic interpolation. No prefiltering is done
    ; |5 - Nearest-neighbor interpolation
    ; |6 - High-quality, bilinear interpolation. Prefiltering is performed to ensure high-quality shrinking
    ; |7 - High-quality, bicubic interpolation. Prefiltering is performed to ensure high-quality shrinking
    ; 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 .......: The interpolation mode determines the algorithm that is used when images are scaled or rotated
    ; Related .......: _GDIPlus_GraphicsGetInterpolationMode
    ; Link ..........; @@MsdnLink@@ GdipSetInterpolationMode
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hGraphics, "int", $iInterpolationMode)

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

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

    [/autoit]

    Gruß,
    UEZ

  • GDI + Backbuffer ???

    • UEZ
    • 23. Februar 2012 um 22:08

    Sorry, ich verstehe nicht ganz was du machen willst.

    Hilft dir das hier weiter?

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>

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

    _GDIPlus_Startup()

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

    $Breite = 600
    $Hoehe = 400
    $y = 110

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

    $TestGUI = GUICreate("Test", $Breite, $Hoehe, 192, 124)
    $NeuZeichnen = GUICtrlCreateButton("Neu zeichnen", 424, 48, 75, 25)
    GUISetState(@SW_SHOW)
    $iRGB = "0xFF" & _WinAPI_GetGUIBkColor($TestGUI)
    Global $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png")
    $Grafik = _GDIPlus_GraphicsCreateFromHWND($TestGUI)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($Breite/2, $Hoehe, $Grafik)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    $hHintergrund = _GDIPlus_ImageLoadFromFile($sFile)
    _GDIPlus_GraphicsClear($Buffer, $iRGB)
    _GDIPlus_GraphicsDrawImage($Buffer, $hHintergrund, 0, 50)
    _GDIPlus_GraphicsDrawString($Buffer, "Test1", 70, 110)
    _GDIPlus_GraphicsDrawImage($Grafik, $Bitmap, 0, 0)

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

    AdlibRegister("Scroll", 50)
    $i = 2
    While Sleep(10)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister("Scroll")
    _GDIPlus_ImageDispose($hHintergrund)
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Grafik)
    _GDIPlus_Shutdown()
    Exit
    Case $NeuZeichnen
    $i += 1
    EndSwitch
    WEnd

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

    Func Scroll()
    _GDIPlus_GraphicsClear($Buffer, $iRGB)
    _GDIPlus_GraphicsDrawImage($Buffer, $hHintergrund, 0, 50)
    _GDIPlus_GraphicsDrawString($Buffer, "Test" & $i, 70, $y)
    _GDIPlus_GraphicsDrawImage($Grafik, $Bitmap, 0, 0)
    If $y = -10 Then $y = $Hoehe
    $y -= 1
    EndFunc

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

    Func _WinAPI_GetGUIBkColor($hWnd) ;taken from WinAPIEx.au3
    Local $hDC = _WinAPI_GetDC($hWnd)
    If Not $hDC Then Return SetError(1, 0, 0)
    Local $bgcolor = DllCall("GDI32.dll", "int", "GetBkColor", "hwnd", $hDC)
    If @error Or $bgcolor[0] = -1 Then Return SetError(2, 0, 0)
    _WinAPI_ReleaseDC($hWnd, $hDC)
    $bgcolor = $bgcolor[0] ;BGR
    $bgcolor = Hex(BitOR(BitAND($bgcolor, 0x00FF00), BitShift(BitAND($bgcolor, 0x0000FF), -16), BitShift(BitAND($bgcolor, 0xFF0000), 16)), 6) ;convert to RGB
    Return $bgcolor ;return RGB
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • GDI + Backbuffer ???

    • UEZ
    • 23. Februar 2012 um 13:31

    Es kommt darauf an, was du genau machen willst! Wenn du "nur" Test1 löschen und Test2 schreiben möchtest, dann mache das lieber mit GUICtrlCreateLabel().

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>

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

    _GDIPlus_Startup()

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

    $Breite = 600
    $Hoehe = 400

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

    $TestGUI = GUICreate("Test", $Breite, $Hoehe, 192, 124)
    $NeuZeichnen = GUICtrlCreateButton("Neu zeichnen", 424, 48, 75, 25)
    GUISetState(@SW_SHOW)
    $iRGB = "0xFF" & _WinAPI_GetGUIBkColor($TestGUI)

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

    $Grafik = _GDIPlus_GraphicsCreateFromHWND($TestGUI)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($Breite/2, $Hoehe, $Grafik)
    $Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsClear($Buffer, $iRGB)
    _GDIPlus_GraphicsDrawString($Buffer, "Test1", 170, 110)
    _GDIPlus_GraphicsDrawImage($Grafik, $Bitmap, 0, 0)

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

    $i = 2

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

    While Sleep(10)
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($Buffer)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($Grafik)
    _GDIPlus_Shutdown()
    Exit
    Case $NeuZeichnen
    _GDIPlus_GraphicsClear($Buffer, $iRGB)
    _GDIPlus_GraphicsDrawString($Buffer, "Test" & $i, 170, 110)
    _GDIPlus_GraphicsDrawImage($Grafik, $Bitmap, 0, 0)
    $i +=1
    EndSwitch
    WEnd

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

    Func _WinAPI_GetGUIBkColor($hWnd) ;taken from WinAPIEx.au3
    Local $hDC = _WinAPI_GetDC($hWnd)
    If Not $hDC Then Return SetError(1, 0, 0)
    Local $bgcolor = DllCall("GDI32.dll", "int", "GetBkColor", "hwnd", $hDC)
    If @error Or $bgcolor[0] = -1 Then Return SetError(2, 0, 0)
    _WinAPI_ReleaseDC($hWnd, $hDC)
    $bgcolor = $bgcolor[0] ;BGR
    $bgcolor = Hex(BitOR(BitAND($bgcolor, 0x00FF00), BitShift(BitAND($bgcolor, 0x0000FF), -16), BitShift(BitAND($bgcolor, 0xFF0000), 16)), 6) ;convert to RGB
    Return $bgcolor ;return RGB
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Arrays vergleichen und doppelte Einträge löschen.

    • UEZ
    • 22. Februar 2012 um 23:01

    Schaue mal hier rein, ob das Performant genug ist: ArrayUnique ohne Bug´s und Schneller

    Vergiss es, geht am Thema vorbei!

    Sorry,
    UEZ

  • GDIPlus Fraktale

    • UEZ
    • 22. Februar 2012 um 13:12

    Kurz und elegant gelöst! :thumbup:

    Top!

    Gruß,
    UEZ

  • Wie steht ihr zu Fasching?

    • UEZ
    • 21. Februar 2012 um 23:10

    Ich habe noch nie Fasching gemocht und werde es sehr wahrscheinlich auch nie mögen, aber ich liebe den Karnveval in Rio...

    http://www.brazilcarnival.com.br/videos :rock:

    Gruß,
    UEZ

  • Animiertes Label?

    • UEZ
    • 21. Februar 2012 um 22:49

    Vielleicht so?

    Spoiler anzeigen
    [autoit]


    #include <String.au3>
    #include <StaticConstants.au3>

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

    Global $startcd = 10
    $hGUI = GUICreate("Test", 200, 100)
    $idLabel = GUICtrlCreateLabel(".......... "& $startcd & " ..........", 0, 40, 200, 50, $SS_CENTER)
    GUICtrlSetFont(-1, 10)
    GUISetState()

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

    AdlibRegister("Countdown", 99)

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

    Do
    Until GUIGetMsg() = -3

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

    AdlibUnRegister("Countdown")
    Exit

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

    Func Countdown()
    Local Static $c = 10
    If Not $startcd Then AdlibUnRegister("Countdown")
    Local $s = _StringRepeat(".", $c)
    GUICtrlSetData($idLabel, $s & " " & $startcd & " " & $s)
    $c = Mod($c - 1, 10)
    If Not $c Then
    $c = 10
    $startcd -= 1
    EndIf
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Inputbox Timeout

    • UEZ
    • 21. Februar 2012 um 21:51

    Schaue dir doch mal in der Help Datei unter InputBox den 9. Parameter an ;)

    Gruß,
    UEZ

  • GDIPlus Digitaluhr

    • UEZ
    • 21. Februar 2012 um 21:32
    Zitat von Andy

    name22, sieht gut aus :thumbup: sehr geschmeidig animiert!

    Jeahaha

    und wo ist deine Uhr?
    Und bevor du mich fragst, wo meine ist...

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <Timers.au3>

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

    Dim $ws[12] = [0, 0, 10, -7, 50, -7, 60, 0, 50, 7, 10, 7] ;Koordinaten Polygonzug: von links nach rechts WAAGRECHTER Balken, von rechts nach links SENKRECHTER Balken
    Dim $ziffer[10] = [239, 10, 118, 94, 154, 220, 253, 14, 254, 222] ;alle gesetzten bits des Indexes in der 7-segmentanzeige ergeben die Ziffer
    Dim $balkenpos[8] = [0, "60.0", "0.0", "60.60", "0.60", "0.60", "0.120", "0.0"] ;position der Leuchtbalken der 7-Segmentanzeige innerhalb der Ziffer
    Dim $p[7][2] ;nimmt die polygonzug-koordinaten zum Zeichnen auf
    $p[0][0] = 6 ;6 Punkte im Polygonzug

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

    Global $hgui = GUICreate('Uhr', 620, 175, -1, -1, $WS_POPUP, $WS_EX_CONTROLPARENT) ;GUI erstellen ohne Rahmen
    GUISetBkColor(0x000000) ;Hintergrund der GUI schwarz
    WinSetTrans($hgui, "", 205) ;transparenz
    GUISetState() ;GUI anzeigen

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

    _GDIPlus_Startup()
    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hgui) ;"Leinwand" erstellen, auf der gezeichnet werden kann
    ;_time()
    _Timer_SetTimer($hgui, 1000, "_TIMER_CALLBACK")

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

    Do ;Endlosschleife, solange bis..
    Until GUIGetMsg() = -3 ;..ESC gedrückt wird

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

    _Timer_KillAllTimers($hgui)
    _GDIPlus_GraphicsDispose($hGraphic) ;freigeben
    _GDIPlus_Shutdown()

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

    Func _TIMER_CALLBACK($hWnd, $Msg, $iIDTimer, $dwTime)
    ;Uhrzeit anzeigen :o)
    For $k = 1 To 6 ;die 6 Ziffern der Uhrzeit
    $setbits = $ziffer[StringMid(String(@HOUR & @MIN & @SEC), $k, 1)] ;gesetzte Bits in der siebensegmentanzeige anhand der Ziffer in der Uhrzeit holen
    For $bitnr = 7 To 1 Step -1 ;alle Bits durchlaufen
    _drawpolygon(BitAND($setbits, 128), $k * 100 - 80 + ($k = 1 Or $k = 3 Or $k = 5) * 20, $bitnr) ;parameter: bit gesetzt ja/nein, position der gesamten ziffer,nummer des bits(gerade=waagrechter balken, ungerade=senkrechter balken)
    $setbits = BitShift($setbits, -1) ;nächstes Bit holen
    Next
    Next
    $brush = _GDIPlus_BrushCreateSolid(0xFF440000 + (@SEC / 2 = Int(@SEC / 2)) * 0xBB0000) ;Pinsel erstellen, wenn Ziffer gerade, dann farbig, ansonsten schwarz
    _GDIPlus_GraphicsFillEllipse($hGraphic, 202, 55, 15, 15, $brush) ;Punkte zeichnen
    _GDIPlus_GraphicsFillEllipse($hGraphic, 402, 55, 15, 15, $brush)
    _GDIPlus_GraphicsFillEllipse($hGraphic, 202, 105, 15, 15, $brush)
    _GDIPlus_GraphicsFillEllipse($hGraphic, 402, 105, 15, 15, $brush)
    _GDIPlus_BrushDispose($brush) ;Pinsel auflösen
    EndFunc ;==>_TIMER_CALLBACK

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

    Func _drawpolygon($bit, $xpos, $bitnr) ;zeichnet einen polygonzug ("Balken") an die entsprechende Position
    $split = StringSplit($balkenpos[$bitnr], ".", 3) ;x- und y-koordinaten des Balkens innerhalb der Ziffer holen
    $b = (($bitnr / 2) = Int($bitnr / 2)) ;$bit gerade => $b = true => Balken waagrecht, ansonsten Balken senkrecht
    $step = -1 + 2 * $b ;schrittweite durch das $WS-Array
    For $i = 11 - 11 * $b To 11 * $b Step 2 * $step ;array mit waagrechten (bit=gerade) oder (Bit=ungerade) senkrechten Balken füllen
    $r = Int(Abs((11 * (Not ($b))) - $i) / 2) + 1 ;abhängig von der Reihenfolge, egal ob $i von 0 bis 11 oder von 11 bis 0, $r muss immer 1,2,3,4,5,6
    $p[$r][0] = $ws[$i] + $split[0] + $xpos ;x- und
    $p[$r][1] = $ws[$i + $step] + $split[1] + 30 ;y-position in das polygonarray schreiben
    Next
    $brush = _GDIPlus_BrushCreateSolid(0xFF440000 + ($bit <> 0) * 0xBB0000) ;wenn bit gesetzt, dann farbig, ansonsten schwarz
    _GDIPlus_GraphicsFillPolygon($hGraphic, $p, $brush) ;Balken zeichnen
    _GDIPlus_BrushDispose($brush)
    EndFunc ;==>_drawpolygon

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

    sind auch "nur" 50 Zeilen Code...

    Alles anzeigen

    Sehr effizient gecodet! :thumbup:

    Fehlt "nur" noch eine Zeile, z.B. in Zeile 19:

    [autoit]


    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)

    [/autoit]

    Dann sieht's richtig "rund" aus, ;)

    Gruß,
    UEZ

  • GDIPlus Digitaluhr

    • UEZ
    • 21. Februar 2012 um 21:12

    name22: du kannst den Font auch direkt laden und benutzen, ohne ihn vorher installieren zu müssen!

    Finde gerade kein Beispiel...

    Gruß,
    UEZ

  • GDIPlus Digitaluhr

    • UEZ
    • 21. Februar 2012 um 20:59

    @Marsi: auf meinem Win7 x64 + Aero wird die Uhr in einem schwarzem Rechteck angezeigt, d.h. keine Transparenz.

    name22: nette Idee!

    Gruß,
    UEZ

  • Gui Design Frage

    • UEZ
    • 20. Februar 2012 um 21:50

    Probiere es mal damit:

    [autoit]


    #include <WindowsConstants.au3>

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

    $hGUI = GUICreate("Test", 320, 256, -1, -1, $WS_POPUPWINDOW, $WS_EX_STATICEDGE + $WS_EX_CLIENTEDGE + $WS_EX_DLGMODALFRAME)

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

    GUISetState()

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

    Do
    Until GUIGetMsg() = -3

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

    Exit

    [/autoit]

    Gruß,
    UEZ

  • Ping aus CSV Datei

    • UEZ
    • 20. Februar 2012 um 21:09

    Hi Oynama Schickidim Schickidim,

    vielleicht kannst du hieraus was gebrauchen: Check Online Status v0.97 Build 2011-11-27 Beta

    Gruß,
    UEZ

    PS: Tarkan lässt Grüßen ;)

  • WinMove auf Mausposition zieht zuerst weg ..

    • UEZ
    • 19. Februar 2012 um 19:32

    Sowas?

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.8.0
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------
    #include <GUIConstantsEx.au3>
    #include "GUICreateTransparent.au3"
    #Include <Misc.au3>
    $iGW = 300
    $iGH= 200
    $hGUI = _GUICreate_Transparent(@ScriptDir & "\UglyBird.png",$iGW,$iGH)
    $iW = 321
    $iH = 347
    $iPosX=124
    $iPosY=142
    $hChild = GUICreate("Form1", $iW, $iH, $iPosX,$iPosY,$WS_POPUP,$WS_EX_LAYERED+$WS_EX_MDICHILD, $hGUI)
    GUISetBkColor(0x000000,$hChild)
    GUISetState(@SW_SHOW, $hGUI)
    GUISetState(@SW_SHOW, $hChild)
    _WinAPI_SetLayeredWindowAttributes($hChild, 0x123456, 0xff)
    WinSetOnTop($hChild, "", 0)
    $dll = DllOpen("user32.dll")

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

    While 1
    _CheckMove()
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    DllClose($dll)
    GUIRegisterMsg($WM_LBUTTONDOWN, "")
    Exit
    EndSwitch
    WEnd

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

    Func _CheckMove()
    If _IsPressed("01", $dll) Then
    sleep(20)
    $Pos = MouseGetPos()
    WinMove($hGUI,"",$Pos[0]-$iW/2-$iPosX, $Pos[1]-$iH/2-$iPosY) ; + 124 , weil Left von $hGUI 123 weniger ist als bei $hChild, + 142, wegen Top
    ;~ WinMove($hGUI,"",$Pos[0]-$aPosWin[0],$Pos[1]-$aPosWin[1])
    EndIf
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • WinMove auf Mausposition zieht zuerst weg ..

    • UEZ
    • 19. Februar 2012 um 18:57

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.8.0
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------
    #include <GUIConstantsEx.au3>
    #include "GUICreateTransparent.au3"
    #Include <Misc.au3>
    Global Const $SC_DRAGMOVE = 0xF012
    $hGUI = _GUICreate_Transparent(@ScriptDir & "\UglyBird.png",300,200)
    $hChild = GUICreate("Form1", 321, 347, 124, 142,$WS_POPUP,$WS_EX_LAYERED+$WS_EX_MDICHILD, $hGUI)
    GUISetBkColor(0x000000,$hChild)
    GUISetState(@SW_SHOW, $hGUI)
    GUISetState(@SW_SHOW, $hChild)
    _WinAPI_SetLayeredWindowAttributes($hChild, 0x123456, 0xff)
    WinSetOnTop($hChild, "", 0)
    $dll = DllOpen("user32.dll")

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

    GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")

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

    While 1
    ;~ _CheckMove()
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    DllClose($dll)
    GUIRegisterMsg($WM_LBUTTONDOWN, "")
    Exit
    EndSwitch
    WEnd

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

    Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
    _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
    EndFunc ;==>_WM_LBUTTONDOWN

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

    Func _CheckMove()
    If _IsPressed("01", $dll) Then
    sleep(20)
    $Pos = MouseGetPos()
    WinMove($hChild,"",$Pos[0] + 124,$Pos[1] + 142) ; + 124 , weil Left von $hGUI 123 weniger ist als bei $hChild, + 142, wegen Top
    WinMove($hGUI,"",$Pos[0],$Pos[1])
    EndIf
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Happy Birthday chip

    • UEZ
    • 19. Februar 2012 um 14:15

    Herzlichen Glückwunsch zum Geburtstag!

    Gruß,
    UEZ

  • UEZ hat Geburtstag

    • UEZ
    • 18. Februar 2012 um 13:19
    Zitat von eukalyptus

    Hey, Alles Gute zum Geburtstag!

    Sagt man ab 40 eigentlich noch Geburtstagskind oder schon Jubilar? :P

    lgE

    Ich würde sagen Alter Sack ;)

    Danke an alle,
    UEZ

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™