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

  • Splash Ladebildschirm (ähnlich wie bei Office 2010)

    • UEZ
    • 6. Juni 2010 um 22:08

    Gefällt mir sehr gut!


    Gruß,
    UEZ

  • Hardware ID und Devcon.exe

    • UEZ
    • 6. Juni 2010 um 21:19

    SIC2 liest nur per Registry und WMI aus!

    Apropros WMI: du kannst eine Menge an System Infos per WMI abfragen, wie z.B. DeviceBus IDs, etc.

    Ein sehr hilfreiches Tools zu WMI ist Scriptomatic! Den Code in AutoIt umzuwandeln ist relativ einfach!

    Gruß,
    UEZ

  • Devcon.exe

    • UEZ
    • 6. Juni 2010 um 20:33

    So geht es bei mir:

    [autoit]


    #include <Constants.au3>
    Local $line
    Local $prg = @ScriptDir & "\devcon.exe "
    Local $parameter = "hwids *"
    Local $run = Run(@ComSpec & " /c " & $prg & $parameter, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
    While 1
    $line &= StdoutRead($run)
    If @error Then ExitLoop
    Wend
    MsgBox(0, "", $line)

    [/autoit]

    Gruß,
    UEZ

  • Fliegende Schrift über Bild mit GDI

    • UEZ
    • 5. Juni 2010 um 16:58

    Ich habe mal deinen Code etwas verändert, so dass jetzt mit einem Backbuffer gearbeitet wird, um das Flackern zu verhindern.

    Spoiler anzeigen
    [autoit]


    #include-once
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>
    #include <WinAPI.au3>
    #include <GDIPlus.au3>
    #include <StaticConstants.au3>

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

    $Gui_width = 430
    $Gui_height = 236
    $Gui_Pos_X = -1
    $Gui_Pos_Y = -1

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

    $hGui = GUICreate('', $Gui_width, $Gui_height ,$Gui_Pos_X,$Gui_Pos_y,$WS_POPUP, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
    WinSetTrans($hGui, "",0)
    GUISetState()
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($Gui_width, $Gui_height, $hGraphic)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    $hImage = _SetImagefromResource(0, "hg", "data.dll",2)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
    $hBrush_Label = _GDIPlus_BrushCreateSolid (0xFFB0C4DE)
    $hBrush_Label2 = _GDIPlus_BrushCreateSolid (0xFF000000)
    $hFormat_Label = _GDIPlus_StringFormatCreate ()
    $hFamily_Label = _GDIPlus_FontFamilyCreate ("Arial")
    $hFont_Label = _GDIPlus_FontCreate ($hFamily_Label, 8, 2)
    $tLayout_Label = _GDIPlus_RectFCreate ($Gui_width - 60, 3, 100, 20)
    $tLayout_Label2 = _GDIPlus_RectFCreate ($Gui_width - 100, $Gui_height - 50, 100, 80)
    _GDIPlus_GraphicsDrawStringEx ($hGraphic, "v. 2.0.1.64", $hFont_Label, $tLayout_Label, $hFormat_Label, $hBrush_Label)
    _GDIPlus_GraphicsDrawStringEx ($hGraphic, 'Lizenz: ---' & @CRLF & _
    'Beta Version'&@CRLF& _
    'C .Schiffer 2010', $hFont_Label, $tLayout_Label2, $hFormat_Label, $hBrush_Label2)
    _WinFadeIn($hGui)

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

    Sleep ( 300 )
    _StringFadeIn('Starte',50,190)
    ;--------------------------------------------------------------
    ; Hier kommt der zu verarbeitende Prozess rein...
    Sleep ( 200 )
    _StringSetNewText('Starte.',50,190)
    Sleep ( 200 )
    _StringSetNewText('Starte..',50,190)
    Sleep ( 200 )
    _StringSetNewText('Starte...',50,190)
    Sleep ( 200 )
    _StringSetNewText('Starte....',50,190)
    Sleep ( 200 )
    ;--------------------------------------------------------------
    _StringFadeOut('Starte....',50,190)

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

    _StringFadeIn('prüfe Daten',50,190)
    ;--------------------------------------------------------------
    ; Hier kommt der zu verarbeitende Prozess rein...
    Sleep ( 200 )
    _StringSetNewText('prüfe Daten.',50,190)
    Sleep ( 200 )
    _StringSetNewText('prüfe Daten..',50,190)
    Sleep ( 200 )
    _StringSetNewText('prüfe Daten...',50,190)
    Sleep ( 200 )
    _StringSetNewText('prüfe Daten....',50,190)
    Sleep ( 200 )
    ;--------------------------------------------------------------
    _StringFadeOut('prüfe Daten....',50,190)

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

    _StringFadeIn('starte Server',50,190)
    ;--------------------------------------------------------------
    ; Hier kommt der zu verarbeitende Prozess rein...
    Sleep ( 200 )
    _StringSetNewText('starte Server (15%)',50,190)
    Sleep ( 200 )
    _StringSetNewText('starte Server (30%)',50,190)
    Sleep ( 200 )
    _StringSetNewText('starte Server (60%)',50,190)
    Sleep ( 200 )
    _StringSetNewText('starte Server (85%)',50,190)
    Sleep ( 200 )
    ;--------------------------------------------------------------
    _StringFadeOut('starte Server (100%)',50,190)
    Sleep (300)
    _WinFadeOut($hGui)

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

    _GDIPlus_FontDispose($hFont_Label)
    _GDIPlus_FontFamilyDispose($hFamily_Label)
    _GDIPlus_StringFormatDispose($hFormat_Label)
    _GDIPlus_BrushDispose($hBrush_Label)
    _GDIPlus_BrushDispose($hBrush_Label2)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown ()
    Exit
    ;-------------------------------------------------------------------------------------------------
    ; Verändern
    ;-------------------------------------------------------------------------------------------------
    Func _StringSetNewText($sString,$Pos_X,$Pos_Y)
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
    Label()
    $hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex(255, 2) & "FFFFFF")
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 13, 1)
    ;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
    $tLayout = _GDIPlus_RectFCreate( $Pos_X, $Pos_Y, 0, 0)
    ;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
    $aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    EndFunc

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

    ;-------------------------------------------------------------------------------------------------
    ; String Einblenden
    ;-------------------------------------------------------------------------------------------------
    Func _StringFadeIn($sString,$Pos_X,$Pos_Y,$Step = 25 ,$Time = 20 )
    $timerinit = TimerInit()
    For $i = 0 To 255 Step $Step
    Do
    Sleep (1)
    Until TimerDiff($timerinit) > $Time
    $timerinit = TimerInit()
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
    Label()
    $hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex($i, 2) & "FFFFFF")
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 13-((255/30)-($i/30)), 1)
    ;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
    If (255/8)-($i/8) < 2 Then
    $Pos_Y_Wert = $Pos_Y+0
    Else
    $Pos_Y_Wert = $Pos_Y+(255/8)-($i/8)
    EndIf
    $tLayout = _GDIPlus_RectFCreate( $Pos_X, $Pos_Y_Wert, 0, 0)
    ;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
    $aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    Next
    EndFunc

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

    ;-------------------------------------------------------------------------------------------------
    ; String Ausblenden
    ;-------------------------------------------------------------------------------------------------
    Func _StringFadeOut($sString,$Pos_X,$Pos_Y,$Step = 25 ,$Time = 15)
    $timerinit = TimerInit()
    For $i = 255 To 0 Step -$Step
    If $i < 11 Then $i = 0
    Do
    Sleep (1)
    Until TimerDiff($timerinit) > $Time
    $timerinit = TimerInit()
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
    Label()
    $hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex($i, 2) & "FFFFFF")
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 13-((255/30)-($i/30)), 1)
    ;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
    $tLayout = _GDIPlus_RectFCreate($Pos_X, $Pos_Y, 0, 0)
    ;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
    $aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    Next
    EndFunc

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

    ;-------------------------------------------------------------------------------------------------
    ; Gui Einblenden
    ;-------------------------------------------------------------------------------------------------
    Func _WinFadeIn($hGui,$timertime = 20 ,$blendzize = 1.25 )
    WinSetTrans($hGui, "",0)
    GUISetState ( @SW_SHOW, $hGui)
    $i = 1
    $timerinit = TimerInit()
    Do
    If TimerDiff($timerinit) > $timertime Then
    $i = $i*$blendzize
    If $i > 255 Then ExitLoop
    WinSetTrans($hGui, "",$i)
    $timerinit = TimerInit()
    EndIf
    Until $i > 255
    WinSetTrans($hGui, "",255)
    EndFunc

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

    ;-------------------------------------------------------------------------------------------------
    ; Gui Ausblenden
    ;-------------------------------------------------------------------------------------------------
    Func _WinFadeOut($hGui,$timertime = 20 ,$blendzize = 0.75 )
    WinSetTrans($hGui, "",255)
    $i = 255
    $timerinit = TimerInit()
    Do
    If TimerDiff($timerinit) > $timertime Then
    $i = $i*$blendzize
    If $i < 5 Then ExitLoop
    WinSetTrans($hGui, "",$i)
    $timerinit = TimerInit()
    EndIf
    Until $i < 5
    WinSetTrans($hGui, "",0)
    GUISetState ( @SW_HIDE, $hGui)
    EndFunc

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

    ;-------------------------------------------------------------------------------------------------
    ; Image aus dll
    ;-------------------------------------------------------------------------------------------------
    Func _SetImagefromResource($CtrlID, $Resname, $Resfile = -1, $ResType = 10)
    Local Const $IMAGE_BITMAP = 0
    Local Const $STM_SETIMAGE = 0x0172
    Local $hmod, $hwnd, $InfoBlock, $ResSize, $Mem, $pMem, $dll, $dll2, $hData, $pData, $pStream, $ret, $hBitmap, $pBitmap
    $hmod = _WinAPI_LoadLibrary($Resfile)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP(_WinAPI_LoadImage($hmod, $Resname, $IMAGE_BITMAP, 0, 0, 0))
    ;~ If $ResType = 2 Then
    ;~ $hBitmap = _WinAPI_LoadImage($hmod, $Resname, $IMAGE_BITMAP, 0, 0, 0)
    ;~ If @error Then Return SetError(1, 0, 0)
    ;~ $hwnd = GUICtrlGetHandle($CtrlID)
    ;~ If $hwnd = 0 Then Return SetError(2, 0, 0)
    ;~ DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hwnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
    ;~ If @error Then Return SetError(3, 0, 0)
    ;~ EndIf
    Return $hBitmap
    EndFunc

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

    Func Label()
    _GDIPlus_GraphicsDrawStringEx ($hBackbuffer, 'v. 2.0.1.64', $hFont_Label, $tLayout_Label, $hFormat_Label, $hBrush_Label)
    _GDIPlus_GraphicsDrawStringEx ($hBackbuffer, 'Lizenz: ---' & @CRLF & _
    'Beta Version'& @CRLF & _
    'C .Schiffer 2010', $hFont_Label, $tLayout_Label2, $hFormat_Label, $hBrush_Label2)
    EndFunc

    [/autoit]

    Du solltest dir angewöhnen die GDI+ Ressourcen wieder freizugeben, denn du hast damit ein Speicherfresser erzeugt! [Blockierte Grafik: http://www.autoit.de/wcf/images/smilies/13.gif]

    Die Fonts müssen auch nicht immer wieder neu erstellt werden...

    Gruß,
    UEZ

  • GDI+ Problem

    • UEZ
    • 5. Juni 2010 um 00:24

    Meinst du das so?

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <gdiplus.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 625, 192, 124)
    $hwnd = wingethandle($Form1)
    GUISetBkColor(0x0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    ;~ $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
    $ParticleBitmap = _GDIPlus_BitmapCreateFromGraphics(625, 625, $hgraphic)
    $ParticleBitmap2 = _GDIPlus_BitmapCreateFromGraphics(625, 625, $hgraphic)
    $ParticleBuffer = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap)
    $ParticleBuffer2 = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap2)
    $Pen = _GDIPlus_PenCreate(0, 1)
    $Pen2 = _GDIPlus_PenCreate(0, 1)
    _GDIPlus_GraphicsClear($ParticleBuffer)
    _GDIPlus_GraphicsClear($ParticleBuffer2)
    $i = 0
    $plus = 10
    $l = 0
    $z = 295
    while $i < 900

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

    ;_GDIPlus_PenSetColor($Pen, "0xff" & Hex(255, 2) & Hex(($i)/3/10*22, 2) & Hex(0, 2))
    _GDIPlus_PenSetColor($Pen, "0xff" & Hex($i/5/10*13, 2) & Hex($i/5/10*13, 2) & Hex($i/5/10*3.5, 2))

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

    _GDIPlus_GraphicsDrawEllipse($particlebuffer, 625/2-$i/2, 625/2-$i/2, $i, $i, $pen)

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

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $ParticleBitmap, 0, 0, 625, 625)
    $i +=$plus
    sleep(1)

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

    WEnd

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

    While 1

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

    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_BitmapDispose($ParticleBitmap)
    _GDIPlus_GraphicsDispose($ParticleBuffer)
    ;~ _GDIPlus_BrushDispose($Brush)
    _GDIPlus_Shutdown ()
    Exit

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

    EndSwitch

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

    $z = 295

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

    _GDIPlus_GraphicsDrawImageRect($particlebuffer2, $ParticleBitmap, 0, 0, 625, 625)
    _GDIPlus_PenSetColor($Pen2, "0xff" & "00" & Hex(200, 2) & Hex(100, 2))
    ;_GDIPlus_PenSetColor($Pen, "0xff" & Hex($i/5/10*27, 2) & Hex($i/5/10*27, 2) & Hex($i/5/10*3.5, 2))

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

    _GDIPlus_GraphicsDrawEllipse($particlebuffer2, 625/2-$i/2, 625/2-$i/2, $i, $i, $pen2)

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

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $ParticleBitmap2, 0, 0, 625, 625)
    $i +=$plus
    sleep(10)

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

    if $i < 900 then
    $i +=1
    Else
    $i = 0
    EndIf

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

    sleep(10)

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

    WEnd

    [/autoit]

    Tipp: Schaue dir doch mal die anderen Beispiele an, wie man GDI+ "besser" darstellen kann. Stichwörter: GUISetOnEvent(), GUIRegisterMsg($WM_PAINT, "WM_PAINT"), GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND"), etc.

    Gruß,
    UEZ

  • GDI+ Kreis

    • UEZ
    • 3. Juni 2010 um 21:02

    Einen "ausgemalten" Kreis kannst du mit _GDIPlus_GraphicsFillEllipse() erstellen.

    Beispiel:

    [autoit]


    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>

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

    Opt('MustDeclareVars', 1)

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

    _Main()

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

    Func _Main()
    Local $hGUI, $hGraphic, $hBrush

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

    ; Create GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState()

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

    ; Draw an ellipse
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000)
    _GDIPlus_GraphicsFillEllipse($hGraphic, 130, 70, 140, 140, $hBrush)

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

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    ; Clean up resources
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_Shutdown ()

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

    EndFunc ;==>_Main

    [/autoit]


    Gruß,
    UEZ

  • TabItem mit Hintergrundbild

    • UEZ
    • 2. Juni 2010 um 11:05

    Hast du mal hier reingeschaut? -> Eigenes Tab-Register (OwnTab-UDF)


    Gruß,
    UEZ

  • Bild auf Kommando mit einstellbarer Geschwindigkeit drehen

    • UEZ
    • 1. Juni 2010 um 19:12

    Hier ein "fast hack" von mir:

    Spoiler anzeigen
    [autoit]


    #include <GDIplus.au3>
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    Global $Stator = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Stator.png")
    Global $Rotor = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Rotor_small.png")
    Global $Schleifkontakte = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Schleifkontakte.png")
    Global $width = _GDIPlus_ImageGetWidth($Stator)
    Global $height = _GDIPlus_ImageGetHeight($Stator)

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

    Global $dx = _GDIPlus_ImageGetWidth($Rotor)
    Global $dy = _GDIPlus_ImageGetHeight($Rotor)

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

    Global $i

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

    Global $hWnd = GUICreate("GDI+: Example by UEZ", $width, $height, -1, -1, Default)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

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

    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics)
    Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    Global $hFGBitmap = _GDIPlus_BitmapCreateFromGraphics($dx, $dy, $hGraphics)
    Global $hFGBackbuffer = _GDIPlus_ImageGetGraphicsContext($hFGBitmap)

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

    Global $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $dx / 2, $dy / 2)
    _GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)

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

    Global $FG_x = 165
    Global $FG_y = 165
    Global $mid_x = $dx * 0.5
    Global $mid_y = $dy * 0.5

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

    $i = 5

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

    While Sleep(20)
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $Stator, 0, 0) ;draw background
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $Schleifkontakte, 0, 185) ;draw background
    _GDIPlus_GraphicsClear($hFGBackbuffer, 0xFFFFFFFF) ;clear backbuffer from foreground graphics

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

    _GDIPlus_MatrixRotate($hMatrix, $i, 0) ;rotate foreground graphic
    _GDIPlus_GraphicsSetTransform($hFGBackbuffer, $hMatrix)
    _GDIPlus_GraphicsDrawImage($hFGBackbuffer, $Rotor, -$mid_x, -$mid_y)

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

    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hFGBitmap, $FG_x, $FG_y, $dx, $dy) ;copy foreground backbuffer to main backbuffer
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height) ;copy full drawn image to main screen
    WEnd

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

    Func _Exit()
    _GDIPlus_BitmapDispose($Stator)
    _GDIPlus_BitmapDispose($Rotor)
    _GDIPlus_BitmapDispose($Schleifkontakte)
    _GDIPlus_BitmapDispose($hFGBitmap)
    _GDIPlus_GraphicsDispose($hFGBackbuffer)
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Abgerundetes Rechteck (GDI+ Form)

    • UEZ
    • 31. Mai 2010 um 22:13

    Schaue mal hier nach: http://www.autoitscript.com/forum/index.php?showtopic=97362

    Vielleicht kannst du was davon gebrauchen...

    Gruß,
    UEZ

  • Akkustand herausfinden

    • UEZ
    • 31. Mai 2010 um 11:42

    Schaue mal hier -> http://www.autoitscript.com/forum/index.php?showtopic=97159, ob dir das weiterhilft!

    Gruß,
    UEZ

  • Happy Birthday GtaSpider

    • UEZ
    • 27. Mai 2010 um 14:44

    Auch von mir Happy Birthday und alles Gute!

    Gruß,
    UEZ

  • Koda FormDesigner verzweifelung

    • UEZ
    • 27. Mai 2010 um 14:42
    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
    $Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
    $Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio2 = GUICtrlCreateRadio("Radio2", 16, 120, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio3 = GUICtrlCreateRadio("Radio3", 16, 192, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $buttonA = GUICtrlCreateButton("A", 200, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonB = GUICtrlCreateButton("B", 250, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonC = GUICtrlCreateButton("C", 300, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonD = GUICtrlCreateButton("D", 200, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonE = GUICtrlCreateButton("E", 250, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonF = GUICtrlCreateButton("F", 300, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonG = GUICtrlCreateButton("G", 200, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonH = GUICtrlCreateButton("H", 250, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonI = GUICtrlCreateButton("I", 300, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Radio1
    GUICtrlSetState($buttonA, $GUI_SHOW)
    GUICtrlSetState($buttonB, $GUI_SHOW)
    GUICtrlSetState($buttonC, $GUI_SHOW)
    GUICtrlSetState($buttonD, $GUI_HIDE)
    GUICtrlSetState($buttonE, $GUI_HIDE)
    GUICtrlSetState($buttonF, $GUI_HIDE)
    GUICtrlSetState($buttonG, $GUI_HIDE)
    GUICtrlSetState($buttonH, $GUI_HIDE)
    GUICtrlSetState($buttonI, $GUI_HIDE)
    Case $Radio2
    GUICtrlSetState($buttonA, $GUI_HIDE)
    GUICtrlSetState($buttonB, $GUI_HIDE)
    GUICtrlSetState($buttonC, $GUI_HIDE)
    GUICtrlSetState($buttonD, $GUI_SHOW)
    GUICtrlSetState($buttonE, $GUI_SHOW)
    GUICtrlSetState($buttonF, $GUI_SHOW)
    GUICtrlSetState($buttonG, $GUI_HIDE)
    GUICtrlSetState($buttonH, $GUI_HIDE)
    GUICtrlSetState($buttonI, $GUI_HIDE)
    Case $Radio3
    GUICtrlSetState($buttonA, $GUI_HIDE)
    GUICtrlSetState($buttonB, $GUI_HIDE)
    GUICtrlSetState($buttonC, $GUI_HIDE)
    GUICtrlSetState($buttonD, $GUI_HIDE)
    GUICtrlSetState($buttonE, $GUI_HIDE)
    GUICtrlSetState($buttonF, $GUI_HIDE)
    GUICtrlSetState($buttonG, $GUI_SHOW)
    GUICtrlSetState($buttonH, $GUI_SHOW)
    GUICtrlSetState($buttonI, $GUI_SHOW)
    EndSwitch
    WEnd

    [/autoit]

    So vielleicht?

    Gruß,
    UEZ

    PS: Friede sei mit dir

  • Happy Birthday anno2008 und SEuBo

    • UEZ
    • 26. Mai 2010 um 17:46

    Alles Gute zum Geburtstag wünscht euch UEZ

  • GDI+ Partikelexplosion (noch eine ;-) )

    • UEZ
    • 24. Mai 2010 um 20:49

    Eine Exe in SCR umbenennen macht daraus nicht umbedingt einen richtigen Screensaver - das ist ein wenig komplizierter ;)

    Anonsonsten sieht es gut aus :thumbup:

    Gruß,
    UEZ

  • Dateien in sogenannten Containern verschlüsseln?!

    • UEZ
    • 15. Mai 2010 um 12:55

    Hier was aus dem engl. Forum: FAF Archive format

    Slm,
    UEZ

  • GDI+ Partikelexplosion

    • UEZ
    • 13. Mai 2010 um 12:20

    name22, du entwickelst dich ganz gut in Sachen GDI+ :!: Weiter so :thumbup:

    Btw, ich hatte auch mal so was ähnliches geschrieben - > Particle Explosions

    In meinem Kopf schwirrt immer noch die Implementierung eines Feuerwerks rum :wacko: Mal sehen, wann ich es umsetzen kann...

    Gruß,
    UEZ

  • GDI+ Digitaluhr und Drag & Drop Alternative

    • UEZ
    • 11. Mai 2010 um 17:25
    Zitat von Alizame

    UEZ
    hast du nicht noch ne idee wie man das ganze transparent machen kann?also das die zeit dann aufm desktop ist und man die dortrumwerfen kann?

    Also, mein Desktop hat die Auflösung 1920x1200 -> kann langsam werden, wenn man "double buffering" benutzt!

    Ja, ich hatte doch mal was mit "Rotating Letters Transparent" veröffentlicht! Dort werden die Buchstaben transparent auf den Desktop dargestellt (nur eine Illusion)!

    Schau' mal in meiner Signatur.

    Gruß,
    UEZ

  • GDI+ Digitaluhr und Drag & Drop Alternative

    • UEZ
    • 11. Mai 2010 um 14:27

    Nimm doch anstelle der Uhr eine Kugel, die du in der GUI "rumwerfen" kannst, natürlich mit Gravitation. ;)

    Gruß,
    UEZ

  • GDI+: Gui transparent wegen transparenter GDI+ Grafik

    • UEZ
    • 7. Mai 2010 um 21:59

    Sollte mit dieser Funktion sollte es so funktionieren, wie du es willst oder?

    [autoit]


    ...
    Func _MenuShow()
    _Time("stop")
    HotKeySet("{PAUSE}")

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

    Local $iWidth = 200
    Local $iHeight = 300
    Local $iRadius = 30
    Local $iOffset = 3

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

    GUISetState(@SW_DISABLE, $hGui)
    Opt("GUIOnEventMode", 0)

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

    $hGuiMenu = GUICreate("Menü", $iWidth + 6, $iHeight + 6, -1, -1, 0, $WS_EX_LAYERED)
    $hGuiMenu1 = GUICreate("", 80, 25, -1, -1, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST, $hGuiMenu)
    GUISetBkColor(0xF0F0F0)
    $hContinue = GUICtrlCreateButton("Weiter", 0, 0, 80, 25)

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

    GUISetState(@SW_SHOW, $hGuiMenu1)
    GUISetState(@SW_SHOW, $hGuiMenu)

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

    _WinAPI_SetLayeredWindowAttributes($hGuiMenu1, 0xF0F0F0)
    WinSetTrans ($hGuiMenu1, "", 0xC0)
    $hGraphicMenu = _GDIPlus_GraphicsCreateFromHWND($hGuiMenu)
    $hBitmapMenu = _GDIPlus_BitmapCreateFromGraphics($iWidth + 6, $iHeight + 6, $hGraphicMenu)
    $hBufferMenu = _GDIPlus_ImageGetGraphicsContext($hBitmapMenu)

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

    #region
    $ScreenDc = _WinAPI_GetDC($hGuiMenu)
    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmapMenu)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)
    _WinAPI_SelectObject($dc, $gdibitmap)
    ; _WinAPI_UpdateLayeredWindow parameters
    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $iWidth + 6)
    DllStructSetData($tSize, "Y", $iHeight + 6)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", 0xF0)
    DllStructSetData($tBlend, "Format", 1)
    $tPoint = DllStructCreate($tagPOINT)
    $pPoint = DllStructGetPtr($tPoint)
    DllStructSetData($tPoint, "X", 0)
    DllStructSetData($tPoint, "Y", 0)

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

    $Brush_BG = _GDIPlus_BrushCreateSolid(0xAAFFA500)
    $Pen_BG_Line = _GDIPlus_PenCreate(0xFF000000, 3)
    $Pen_BG_Arc = _GDIPlus_PenCreate(0xFF000000, 3)
    _GDIPlus_GraphicsFillRect($hBufferMenu, $iOffset, $iRadius + $iOffset, $iRadius, $iHeight - $iRadius * 2, $Brush_BG)
    _GDIPlus_GraphicsFillPie($hBufferMenu, $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 180, 90, $Brush_BG)
    _GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iOffset, $iWidth - $iRadius * 2, $iRadius, $Brush_BG)
    _GDIPlus_GraphicsFillPie($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 270, 90, $Brush_BG)
    _GDIPlus_GraphicsFillRect($hBufferMenu, $iWidth - $iRadius + $iOffset, $iRadius + $iOffset, $iRadius, $iHeight - $iRadius * 2, $Brush_BG)
    _GDIPlus_GraphicsFillPie($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 0, 90, $Brush_BG)
    _GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iHeight - $iRadius + $iOffset, $iWidth - $iRadius * 2, $iRadius, $Brush_BG)
    _GDIPlus_GraphicsFillPie($hBufferMenu, $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 90, 90, $Brush_BG)
    _GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iRadius + $iOffset, $iWidth - $iRadius * 2, $iHeight - $iRadius * 2, $Brush_BG)
    _GDIPlus_GraphicsSetSmoothingMode($hBufferMenu, 2)
    _GDIPlus_GraphicsDrawLine($hBufferMenu, $iOffset, $iHeight - $iRadius + $iOffset, $iOffset, $iRadius + $iOffset, $Pen_BG_Line)
    _GDIPlus_GraphicsDrawArc($hBufferMenu, $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 180, 90, $Pen_BG_Arc)
    _GDIPlus_GraphicsDrawLine($hBufferMenu, $iRadius + $iOffset, $iOffset, $iWidth - $iRadius + $iOffset, $iOffset, $Pen_BG_Line)
    _GDIPlus_GraphicsDrawArc($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 270, 90, $Pen_BG_Arc)
    _GDIPlus_GraphicsDrawLine($hBufferMenu, $iWidth + $iOffset, $iRadius + $iOffset, $iWidth + $iOffset, $iHeight - $iRadius + $iOffset, $Pen_BG_Line)
    _GDIPlus_GraphicsDrawArc($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 0, 90, $Pen_BG_Arc)
    _GDIPlus_GraphicsDrawLine($hBufferMenu, $iRadius + $iOffset, $iHeight + $iOffset, $iWidth - $iRadius + $iOffset, $iHeight + $iOffset, $Pen_BG_Line)
    _GDIPlus_GraphicsDrawArc($hBufferMenu, $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 90, 90, $Pen_BG_Arc)
    _GDIPlus_GraphicsSetSmoothingMode($hBufferMenu, 2)

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

    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmapMenu)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_UpdateLayeredWindow($hGuiMenu, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
    _WinAPI_DeleteObject($gdibitmap)

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

    ;~ _GDIPlus_GraphicsDrawImageRect($hGraphicMenu, $hBitmapMenu, 0, 0, $iWidth + 6, $iHeight + 6)
    #endregion

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

    While 1
    Switch GUIGetMsg()
    Case $hContinue
    _GDIPlus_PenDispose($Pen_BG_Line)
    _GDIPlus_PenDispose($Pen_BG_Arc)
    _GDIPlus_BrushDispose($Brush_BG)
    _WinAPI_DeleteDC($dc)
    _WinAPI_ReleaseDC($hGuiMenu, $ScreenDc)
    _GDIPlus_GraphicsDispose($hBufferMenu)
    _GDIPlus_BitmapDispose($hBitmapMenu)
    $tSize = ""
    $tSource = ""
    $tBlend = ""
    $tPoint = ""
    GUISetState(@SW_ENABLE, $hGui)
    GUIDelete($hGuiMenu)
    GUIDelete($hGuiMenu1)
    Opt("GUIOnEventMode", 1)
    HotKeySet("{PAUSE}", "_MenuShow")
    _Time("start")
    Return
    EndSwitch
    WEnd
    EndFunc
    ...

    [/autoit]


    Gruß,
    UEZ

  • GDI+: Gui transparent wegen transparenter GDI+ Grafik

    • UEZ
    • 7. Mai 2010 um 12:02

    Füge in der Funktion _MenuShow() _WinAPI_SetLayeredWindowAttributes($hGuiMenu, 0xf0f0f0) ein.

    [autoit]


    ...
    $hGuiMenu = GUICreate("Menü", $iWidth + 6, $iHeight + 6, Default, Default, $WS_POPUP, $WS_EX_LAYERED, $hGui)
    $hContinue = GUICtrlCreateButton("Weiter", 40, 40, 80, 25)
    _WinAPI_SetLayeredWindowAttributes($hGuiMenu, 0xf0f0f0)
    GUISetState()
    ...

    [/autoit]

    Dann sollte die GUI transparent sein.

    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™