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

  • Label auf GDI+ Background

    • UEZ
    • 6. März 2012 um 09:07

    Lasse $WS_BORDER in Zeile 56 einfach weg.

    Gruß,
    UEZ

  • Label auf GDI+ Background

    • UEZ
    • 5. März 2012 um 13:42

    Du kannst mal

    [autoit]


    GUICtrlSetFont (-1,10,400,0,"Arial", 4)

    [/autoit]

    probieren.

    Gruß,
    UEZ

  • Label auf GDI+ Background

    • UEZ
    • 4. März 2012 um 22:53

    Lasse doch die Transparenz vom Label weg und setze die Hintergrundfarbe vom Label schwarz.

    Spoiler anzeigen
    [autoit]


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

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

    _GDIPlus_Startup()
    Global Const $hImage_BG = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\background.png")
    Global Const $iW = _GDIPlus_ImageGetWidth($hImage_BG)
    Global Const $iH = _GDIPlus_ImageGetHeight($hImage_BG)
    Global Const $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
    SetTransparentBitmap($hGUI, $hImage_BG)
    Global Const $iFW = 90
    Global Const $iFH = 50

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

    Global Const $hGUI_Child = GUICreate("", $iFW, $iFH, 100, 100, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    Global Const $idLabel = GUICtrlCreateLabel("Test", 0, 0, $iFW, $iFH)
    GUICtrlSetBkColor(-1, 0)
    GUICtrlSetColor(-1, 0xF0F0F0)
    GUICtrlSetFont(-1, 32, 400, 0, "Arial", 4)
    GUISetState(@SW_SHOW, $hGUI)
    GUISetState(@SW_SHOW, $hGUI_Child)

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

    _GDIPlus_ImageDispose($hImage_BG)

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

    Global Const $SC_DRAGMOVE = 0xF012
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")

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

    Do
    Until GUIGetMsg() = -3

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

    _GDIPlus_Shutdown()
    Exit

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

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

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

    Func SetTransparentBitmap($hGUI, $hImage, $iOpacity = 0xFF)
    Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
    $hScrDC = _WinAPI_GetDC(0)
    $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
    _WinAPI_ReleaseDC(0, $hScrDC)
    $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
    DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _WinAPI_UpdateLayeredWindow($hGUI, 0, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
    _WinAPI_SelectObject($hMemDC, $hOld)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteDC($hMemDC)
    EndFunc ;==>SetTransparentBitmap

    [/autoit]

    Gruß,
    UEZ

  • GDI+ und QuickDraw zu langsam für 65000 pixel

    • UEZ
    • 3. März 2012 um 17:12

    Andy: Feine Sache! Genau sowas hatte ich mir vorgestellt, aber mit ASM bin ich seit der Primzahlen Geschichte nicht mehr vertraut, obwohl so viel Potential darin steckt!

    Gruß,
    UEZ

  • GDI+ und QuickDraw zu langsam für 65000 pixel

    • UEZ
    • 2. März 2012 um 22:36

    Es ist weder GDI+ noch QuickDraw das Problem, sondern AutoIt!

    256*256=256^2= 65536 Schleifendurchgänge sind für AutoIt als Intepretersprache leider zu langsam. ASM würde dir hier sehr wahrscheinlich weiterhelfen!

    Gruß,
    UEZ

  • Happy Birthday eukalyptus

    • UEZ
    • 2. März 2012 um 22:31

    Herzlichen Glückwunsch Mr. GDI+ und alles Gute!

    Ich hoffe weitere ultra coole GDI+ Demos zu sehen! :thumbup:

    Gruß,
    UEZ

  • Bild vergrößern und bewegen

    • UEZ
    • 2. März 2012 um 22:28

    In AutoIt Windows Screenshooter v1.43 Build 2012-02-16 Final habe ich das implementiert. Du kannst das Vorschaubild mit der Maus bewegen und mit dem Mausrad rein- bzw. rauszoomen.

    Gruß,
    UEZ

  • 1 String Doppelt Splitten

    • UEZ
    • 1. März 2012 um 22:44

    Vielleicht so was?

    [autoit]


    #include <Array.au3>
    $days = "So;So,Mo;Mo,Di;Di,Mi;Mi,Do;Do,Fr;Fr,Sa;Sa"
    $aDays = StringSplit(StringRegExpReplace($days, "(\w+);(\w+)", "$1"), ",", 2)
    _ArrayDisplay($aDays)

    [/autoit]

    Gruß,
    UEZ

  • GDI+ Farbe transparent und als neues Bild speichern

    • UEZ
    • 29. Februar 2012 um 14:57

    Bis ich den Code fertig bekommen habe, hast du es bereits selbst hinbekommen!

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    Opt("GuiOnEventMode", 1)

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

    OnAutoItExitRegister("_end")

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

    $chipsetpfad = FileOpenDialog("Chipset", @ScriptDir & "\", "Bilder (*.png)", 1)
    _GDIPlus_Startup()

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

    $chipset = _GDIPlus_ImageLoadFromFile($chipsetpfad)
    $iW = _GDIPlus_ImageGetWidth($chipset)
    $iH = _GDIPlus_ImageGetHeight($chipset)
    $newchipset = GUICreate("Neues Chipset", $iW, $iH)
    GUISetState(@SW_SHOW)

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($newchipset)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsDrawImage($hGraphics, $chipset, 0, 0)
    _GDIPlus_GraphicsDrawImage($hContext, $chipset, 0, 0)

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, "getPixelcolor")

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

    While 1
    Sleep(100)
    WEnd

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

    Func getPixelcolor()
    $pos = MouseGetPos()
    $pix = PixelGetColor($pos[0], $pos[1])
    $sMsgText = StringFormat("Der hexadezimale Wert der Farbe ist: %#06x\t", $pix)
    MsgBox(0, "PixelGetColor", $sMsgText)
    Local $x, $y, $aResult, $iColor
    For $y = 0 To $iH -1
    For $x = 0 To $iW - 1
    $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "hwnd", $hBitmap, "int", $x, "int", $y, "uint*", 0)
    $iColor = $aResult[4]
    If (("0x" & Hex($iColor, 6)) / $pix) = 1 Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "hwnd", $hBitmap, "int", $x, "int", $y, "uint", "0x00" & Hex($pix, 6))
    Next
    Next
    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Test.png")
    _end()
    EndFunc ;==>getPixelcolor

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

    Func CLOSEClicked()
    _end()
    EndFunc ;==>CLOSEClicked

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

    Func _end()
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_ImageDispose($chipset)
    _GDIPlus_Shutdown()
    ShellExecute(@ScriptDir & "\Test.png")
    Exit
    EndFunc ;==>_end

    [/autoit]

    Die Ideen waren die Gleichen!

    Gruß,
    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

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™