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

  • GDI Plus Script Sammlung von Simon

    • UEZ
    • 31. Oktober 2009 um 12:46
    Zitat von simon

    Hi @all!

    Ich habe mal noch ein anderes mit Quadraten gemacht
    mit einer funktion von mir , die ich vor ein paar wochen gemacht habe

    ich hoffe es gefällt euch auch dieses

    gruss Simon

    Ich hatte auch was mal mit Quadraten gemacht, die sich drehen. ;)

    #03 Rotating Squares

    Gruß,
    UEZ

  • GDI Plus Script Sammlung von Simon

    • UEZ
    • 30. Oktober 2009 um 18:17

    Habe doch so was ähnliches gepostet => [ offen ] GDI Plus Problem!


    An den Farbverläufen kann man noch arbeiten!


    Gruß,

    UEZ

  • GDI Plus Script Sammlung von Simon

    • UEZ
    • 30. Oktober 2009 um 16:19

    Weiter so :thumbup:

    Gruß,
    UEZ

  • GDI Plus Problem

    • UEZ
    • 30. Oktober 2009 um 16:07
    Zitat von simon

    Ok danke

    Habs jetzt mal erweitert

    Spoiler anzeigen
    [autoit]


    ;coded by Simon
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>
    #include <GDIPlus.au3>

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

    Global Const $width = 400
    Global Const $height = 400
    Global $graphics, $backbuffer, $bitmap, $Pen, $i = 10, $bool = 0
    Global $title = "GDI+ Beispiel"

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, $WS_POPUP)
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) ;erstelle GDI+ Objekt von der GUI (Grafik)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) ;erstelle Bitmap von der Grafik
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ;erstelle Grafik Kontext von der Bitmap (dient für die Doppeltbufferung der Grafik, damit die Bewegungen flüssiger aussehen
    $pen = _GDIPlus_PenCreate(0, 3) ;erstelle Stift mit der Stärke 4 Pixels

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

    Do
    _GDIPlus_GraphicsClear($backbuffer) ;lösche Buffer
    _GDIPlus_PenSetColor($Pen, 0xFFFFFFFF) ;setze Stiftfarbe ;# weis +++++++++++++++++++++++++
    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 10, $i, 10, $Pen) ;ziehe 1. Linie
    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 390, 10, 400 - $i, $Pen) ;ziehe 2. Linie
    _GDIPlus_GraphicsDrawLine($backbuffer,390,10,390,$i,$Pen);Ziehe 3. Linie
    _GDIPlus_PenSetColor($Pen, 0xFFF00000) ;setze Stiftfarbe für den 2. Strich ;# rot +++++++++++++++++++
    _GDIPlus_GraphicsDrawLine($backbuffer,$i,10,10,400-$i,$Pen)
    _GDIPlus_GraphicsDrawLine($backbuffer,10,400-$i,400-$i,390,$Pen)
    _GDIPlus_GraphicsDrawLine($backbuffer,390,$i,400 - $i,390,$Pen)
    _GDIPlus_GraphicsDrawLine($backbuffer,$i,10,390,$i,$Pen)
    _GDIPlus_PenSetColor($Pen,0xFFFFFFFF)
    ;_GDIPlus_GraphicsDrawLine($backbuffer,10,,$Pen)
    _GDIPlus_GraphicsDrawLine($backbuffer,400 - $i,390,390,390 ,$Pen) ;Ziehe Dritte Linie
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) ;das Zeichnen hat im Buffer stattgefunden. Damit das Ganze sichtbar wird, kopiere den Buffer (Bitmap) in den sichtbaren Bereich
    If Not $bool And $i < 390 Then
    $i += 5
    Else
    $bool = 1
    EndIf
    If $bool And $i > 10 Then
    $i -= 5
    Else
    $bool = 0
    EndIf
    Sleep(30)
    Until False

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

    Func close()
    _GDIPlus_PenDispose($pen)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc

    [/autoit]

    Wie kann man das jetz machen dass die linien des vierecks immer wieder die farbe wächseln???

    Alles anzeigen

    Zum Beispiel so:

    Spoiler anzeigen
    [autoit]


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

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

    Global Const $width = 400
    Global Const $height = 400
    Global Const $pi_div_180 = 4 * ATan(1) / 180
    Global $graphics, $backbuffer, $bitmap, $Pen, $i = 10, $bool = 0
    Global $r, $g, $b
    Global $title = "GDI+ Beispiel"

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, $WS_POPUP)
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) ;erstelle GDI+ Objekt von der GUI (Grafik)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) ;erstelle Bitmap von der Grafik
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ;erstelle Grafik Kontext von der Bitmap (dient für die Doppeltbufferung der Grafik, damit die Bewegungen flüssiger aussehen
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2) ;Antialiasing
    $pen1 = _GDIPlus_PenCreate(0xFFFFFFFF, 3) ;erstelle Stift mit der Stärke 4 Pixels
    $pen2 = _GDIPlus_PenCreate(0, 3)

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

    Do
    _GDIPlus_GraphicsClear($backbuffer) ;lösche Buffer

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

    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 10, $i, 10, $Pen1) ;ziehe 1. Linie
    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 390, 10, 400 - $i, $Pen1) ;ziehe 2. Linie
    _GDIPlus_GraphicsDrawLine($backbuffer,390,10,390,$i,$Pen1);Ziehe 3. Linie
    _GDIPlus_GraphicsDrawLine($backbuffer,400 - $i,390,390,390 ,$Pen1) ;Ziehe Dritte Linie

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

    $r = (Sin($i / 96) + 1) * 256
    $g = (Sin($i / 64) + 1) * 256
    $b = (Sin($i / 32) + 1) * 256

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

    _GDIPlus_PenSetColor($Pen2, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)) ;setze Stiftfarbe für den 2. Strich ;# rot +++++++++++++++++++

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

    _GDIPlus_GraphicsDrawLine($backbuffer,$i,10,10,400-$i,$Pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer,10,400-$i,400-$i,390,$Pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer,390,$i,400 - $i,390,$Pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer,$i,10,390,$i,$Pen2)

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

    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) ;das Zeichnen hat im Buffer stattgefunden. Damit das Ganze sichtbar wird, kopiere den Buffer (Bitmap) in den sichtbaren Bereich
    If Not $bool And $i < 390 Then
    $i += 5
    Else
    $bool = 1
    EndIf
    If $bool And $i > 10 Then
    $i -= 5
    Else
    $bool = 0
    EndIf
    Sleep(30)
    Until False

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

    Func close()
    _GDIPlus_PenDispose($pen1)
    _GDIPlus_PenDispose($pen2)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • GDI Plus Problem

    • UEZ
    • 29. Oktober 2009 um 22:56

    Hier das ganze mit der doppelten Bufferung:

    Spoiler anzeigen
    [autoit]


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

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

    Global Const $width = 400
    Global Const $height = 400
    Global $graphics, $backbuffer, $bitmap, $Pen, $i = 10, $bool = 0
    Global $title = "GDI+ Beispiel"

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, $WS_POPUP)
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) ;erstelle GDI+ Objekt von der GUI (Grafik)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) ;erstelle Bitmap von der Grafik
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ;erstelle Grafik Kontext von der Bitmap (dient für die Doppeltbufferung der Grafik, damit die Bewegungen flüssiger aussehen
    $pen = _GDIPlus_PenCreate(0, 4) ;erstelle Stift mit der Stärke 4 Pixels

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

    Do
    _GDIPlus_GraphicsClear($backbuffer) ;lösche Buffer
    _GDIPlus_PenSetColor($Pen, 0xFFFFFFFF) ;setze Stiftfarbe
    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 10, $i, 10, $Pen) ;ziehe 1. Linie
    _GDIPlus_PenSetColor($Pen, 0xFFF00000) ;setze Stiftfarbe für den 2. Strich
    _GDIPlus_GraphicsDrawLine($backbuffer, 10, 390, 10, 400 - $i, $Pen) ;ziehe 2. Linie
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) ;das Zeichnen hat im Buffer stattgefunden. Damit das Ganze sichtbar wird, kopiere den Buffer (Bitmap) in den sichtbaren Bereich
    If Not $bool And $i < 390 Then
    $i += 5
    Else
    $bool = 1
    EndIf
    If $bool And $i > 10 Then
    $i -= 5
    Else
    $bool = 0
    EndIf
    Sleep(30)
    Until False

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

    Func close()
    _GDIPlus_PenDispose($pen)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc

    [/autoit]

    Ich hoffe, dass du damit zurecht kommst! Ansonsten einfach fragen!

    Gruß,
    UEZ

  • Multiplayer-Game 'Kurven-Spiel'

    • UEZ
    • 29. Oktober 2009 um 09:29
    Zitat von funkey

    Hat jemand mein Kurven-Spiel bereits auf Windows7 getestet? Wenn ja mit welchem Ergebnis? Möchte jemand die neue Version testen, bevor sie veröffentlicht wird? Hier bitte melden.

    Habe es unter Win7 x64 (*)laufen lassen und es läuft sauber. Was mir nur aufgefallen ist, dass die Schriftgröße nicht immer zur Fenstergröße passt (Zeilenumbruch: Wählen Sie einen Player aus... und Runde x/10 y%)!

    (*) Win7 x64 ohne Aero und sonstige Effekte, da Win7 in einer VM läuft!

    Erinnert mich ein wenig an Tron ;)

    Nettes Spiel :thumbup:

    Gruß,
    UEZ

  • 3D Würfel mit Farbänderung hat Fehler

    • UEZ
    • 28. Oktober 2009 um 00:33
    Zitat von Raupi

    Die Version von UEZ ist besser als meine. ;)


    Nicht besser, übersichtlicher ;)

    UEZ

  • Drop in ein Image

    • UEZ
    • 28. Oktober 2009 um 00:31

    So was?

    Spoiler anzeigen
    [autoit]


    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt('MustDeclareVars', 1)

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

    Global $msg, $w, $h, $Input, $Radio1, $Radio2, $Radio3, $Button, $file
    $w = 640
    $h = 480
    GUICreate("Test", $w, $h, -1, -1, $WS_SIZEBOX + $WS_SYSMENU, $WS_EX_ACCEPTFILES)

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

    GUICtrlCreatePic(@SystemDir & "\oobe\msoobe.jpg", 0,0, $w, $h - 80)

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

    $Input = GUICtrlCreateInput("", 8, 430, 517, 21, $ES_READONLY)
    $Radio1 = GUICtrlCreateRadio("C:\", 8, 408, 57, 17)
    $Radio2 = GUICtrlCreateRadio("D:\", 304, 408, 57, 17)
    $Radio3 = GUICtrlCreateRadio("E:\", 568, 408, 57, 17)
    $Button = GUICtrlCreateButton("OK", 560, 430, 57, 21)

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

    GUIRegisterMsg(0x0233, "WM_DROPFILES") ;0x0233 = $WM_DROPFILES

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

    GUISetState()

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

    While 1
    $msg = GUIGetMsg()

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

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()

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

    Func WM_DROPFILES($hwnd, $msg, $wParam, $lParam)
    Local $tBuffer = DllStructCreate("char[256]")
    Local $iString

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

    ;Get dropped items count
    Local $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", -1, "ptr", 0, "int", 0)

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

    ;Getting name only from 1st dropped item
    DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", 0, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer))
    $iString = DllStructGetData($tBuffer, 1)
    DllCall("shell32.dll", "none", "DragFinish", "int", $wParam)

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

    GUICtrlSetData($Input, $iString)
    If StringLeft($iString, 1) = "c" Then GUICtrlSetState($Radio1, $GUI_CHECKED)
    If StringLeft($iString, 1) = "d" Then GUICtrlSetState($Radio2, $GUI_CHECKED)
    If StringLeft($iString, 1) = "e" Then GUICtrlSetState($Radio3, $GUI_CHECKED)

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

    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_DROPFILES

    [/autoit]

    Eventuell musst du noch den Pfad des Bildes anpassen!

    Gruß,
    UEZ

    Dateien

    Test.au3 1,74 kB – 291 Downloads
  • 3D Würfel mit Farbänderung hat Fehler

    • UEZ
    • 27. Oktober 2009 um 19:43
    Zitat von Kamui

    Hallo,
    Ich habe gerade mit 3D Programmirung in Autoit angefangen und wollte zu Anfang einen sich Rotirenden Würfel der seine Farben wechselt schreiben.
    Ich lasse die farben durch eine Schleiffe immer erhöhen,erst Rot ($R),dann Grün ($G) und dann Blau ($B). Wenn eine Farbe den Wert "1" angenommen hatt, soll sie stehn bleiben und die nächste Farbe weiter bis "1" laufen, nur genau hier ist mein Problem sobald Grün "1" ereicht hat bleibt es nicht stehn sonder läuft als weiter.
    Wäre schön wenn ihr auch das ganze mal anschaut.
    Ihr müsst auch das Rar archiv laden da ein paar dlls benötigt werden.

    Mfg Kamui
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Hier meine Version:

    Spoiler anzeigen
    [autoit]


    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseAnsi=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <GUIConstants.au3>
    #include "GlPluginUtils.au3"

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

    HotKeySet( "{ESC}", "End" )
    Opt( "GUIOnEventMode", 1 )

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

    Func End( )
    Exit
    EndFunc

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

    $desktw = @DesktopWidth
    $deskth = @DesktopHeight

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

    If MsgBox( 36, "Screen", "Run this demo in fullscreen mode?" ) = 6 Then
    DefineGlWindow( "würfel!!!" )
    EndIf

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

    $R = 0
    $G = 0
    $B = 0
    $hGUI = GUICreate( "Au3GlPlugin in a AutoIt GUI", 520, 400 )
    $Label = GUICtrlCreateLabel ( "Rotation: ", 20, 20, 80 )
    GUISetState( @SW_SHOW, $hGUI )
    $Label2 = GUICtrlCreateLabel ( "Rotation: ", 20, 40, 80 )
    GUISetState( @SW_SHOW, $hGUI )
    $Label3 = GUICtrlCreateLabel ( "Color: ", 20, 60, 80 )
    GUISetState( @SW_SHOW, $hGUI )
    $Label4 = GUICtrlCreateLabel ( "R: ", 20, 80, 80 )
    GUISetState( @SW_SHOW, $hGUI )
    $Label5 = GUICtrlCreateLabel ( "G: ", 20, 100, 80 )
    GUISetState( @SW_SHOW, $hGUI )
    $Label6 = GUICtrlCreateLabel ( "B ", 20, 120, 80 )
    GUISetState( @SW_SHOW, $hGUI )

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

    EmbedGlWindow( $hGUI, 400, 300, 100, 20 )

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

    GUISetState( @SW_SHOW, $hGUI )

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

    SetClearColor( 0.2, 0.2, 0.2 )
    CreateLight( 0, 40, 300, 300 )
    SetLightAmbient( 0, 0.2, 0, 0.2 )
    SetLightDiffuse( 0, 0.7, 0.7, 0.7 )
    SetLightSpecular( 0, 1.0, 1.0, 1.0 )

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

    $CubeObj = ObjectCreate( )
    $Box = AddCube( $CubeObj, 70, 70, 70, $R, $G, $B, 1.0 )
    SetPrint( $CubeObj )

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

    SetCamera( 0, 50, 250, 0, 0, 0 )
    GUISetOnEvent( $GUI_EVENT_CLOSE, "End" )

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

    $R = 0
    $G = 0
    $B = 0 ;Zum blocken der Farben
    $block = 1
    $Y_Achse = 0
    $X_Achse = 0
    While 1
    SceneDraw( )
    sleep( 10 )

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

    ;Farbe wechselen

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

    GUICtrlSetData( $Label4, "R: " & Round($R, 3))
    GUICtrlSetData( $Label5, "G: " & Round($G, 3))
    GUICtrlSetData( $Label6, "B: " & Round($B, 3))
    Select
    Case $block = 1
    $R += 0.001
    If $R >= 1 Then $block += 1
    Case $block = 2
    $G += 0.001
    If $G >= 1 Then $block += 1
    Case $block = 3
    $B += 0.001
    If $B >= 1 Then $block += 1
    EndSelect
    If $block = 4 Then
    $r = 0
    $g = 0
    $b = 0
    $block = 1
    EndIf
    ObjectHide( $CubeObj )
    $CubeObj = ObjectCreate( )
    $Box = AddCube( $CubeObj, 70, 70, 70, $R, $G, $B, 1)
    SetPrint( $CubeObj )

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

    ;Rotation
    ObjectRotate( $CubeObj, $Y_Achse, $X_Achse, 0 )
    GUICtrlSetData( $Label, "Rotation: " & $Y_Achse )
    GUICtrlSetData( $Label2, "Rotation: " & $X_Achse )
    $X_Achse += 1
    $Y_Achse += 1
    If $Y_Achse < 0 Then $Y_Achse += 360
    If $Y_Achse > 360 Then $Y_Achse -= 360
    If $X_Achse < 0 Then $X_Achse += 360
    If $X_Achse > 360 Then $X_Achse -= 360
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Weisse Pixel Transparent ?

    • UEZ
    • 27. Oktober 2009 um 12:35

    In dem Skript wird ein PNG transparent dargestellt.

    Allerdings habe ich noch nicht herausgefunden, wie man auf das Bild z.B. Buttons legen kann. Vielleicht eine 2. GUI transparent drüber legen...

    Gruß,
    UEZ

    Dateien

    Test.zip 25,67 kB – 376 Downloads
  • Weisse Pixel Transparent ?

    • UEZ
    • 26. Oktober 2009 um 20:07
    Zitat von Eistee

    Ähm ich finde leider nichts in dem genannten beitrag welches von nutzen wäre...
    ich denke mal es wäre sinnvoller gleich zu sagen um was es im edeffekt geht :
    und zwar möchte ich eine Gui in Form eines X machen und es soll natürlich nur das X zu sehen sein und ich kann mich daran erinnern das transparenz ja nicht funktioniert waäre das also in irgendeine form realisierbar ?

    Wie machst du das X? Ein Bild?

    Gruß,
    UEZ

  • Timeout bei ObjGet?

    • UEZ
    • 26. Oktober 2009 um 19:53

    Schaue dir mal die 2 Links an:

    http://msdn.microsoft.com/en-us/library/…28VS.85%29.aspx
    http://msdn.microsoft.com/en-us/library/…28VS.85%29.aspx

    Es geht um SWbemLocator.ConnectServer Methode, wo man mit iSecurityFlags eine Timeout setzen kann.

    iSecurityFlags:
    wbemConnectFlagUseMaxWait128 (0x80) => The ConnectServer call is guaranteed to return in 2 minutes or less. Use this flag to prevent your program from hanging indefinitely if the connection cannot be established.

    Hatte mit meinem SIC2 ähnliche Probleme, aber ich benutze Multiprozessing, so dass ich dieses Problem nicht mehr habe, da ein Subprozess immer kontrolliert, ob das Hauptprogramm hängt.
    Bei Multiprozessen überwacht das Hauptprogramm die Subprozesse...

    Gruß,
    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 25. Oktober 2009 um 12:32

    Um nicht die Beta durch Doppeltklick zu starten, einfach den Schlüssel in der Registry ändern!

    Vista x32:

    HKEY_CLASSES_ROOT\.au3
    => (Standard) -> AutoIt3ScriptBeta auf AutoIt3Script ändern.

    Sollte unter WinXP ähnlich sein!

    Gruß,
    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 25. Oktober 2009 um 10:38
    Zitat von kleiner27

    Hallo (XP Pro User)

    Mein Test auch bei änderrung!!!

    Bei doppelklick!
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Und rechte maustaste Compile Script!
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Es geht beides nur aus SciTE herraus!!!!!!!!!

    Also vom aussehen super code ! Nur die beiden sachen sind schlecht und nicht für jeden user verständlich voralledem der !!!!!!!!!!!! Virus arlam !!!!!!!!!

    LG Kleiner

    Alles anzeigen


    Habe ich doch glatt ein Virus programmiert :rofl:

    Ich benutze den gleichen VS, habe nicht die Fehlermeldungen!


    Wenn du die neuste Beta im Beta Verzeichnis hast, wird die au3 mit der Beta aufgerufen und deshalb bekommst du die Fehlermeldung, dass _GDIPlus_BrushSetSolidColor() bereits vorhanden ist, denn die Funktion ist bereits in der Beta integriert!
    Irgendwo kann man das so einstellen, dass per Doppeltklick nicht die Beta, sondern die finale Version gestartet wird.

    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 24. Oktober 2009 um 18:00
    Zitat von Raupi

    UEZ
    Ich finde das Script Super.
    Sollte die Transparente Version ein Durchsichtiges Fenster zeigen? Wenn ja, funzt es nicht auf Windows 7.
    Du bist der GDI-Meister unseres Forums. Auch wenn du dich nicht so siehst. Aber wie heißt es, Bescheidenheit ist eine Zier. ;)

    Rotating Letters Transparent läuft bei mir auch unter Win7 x64 sauber!

    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 24. Oktober 2009 um 17:55
    Zitat von simon

    UEZ
    das heist für eine farbige linie braucht man _GDIPlus_PenSetColor($pen, $color)
    oder?
    danke für deine antwort

    Mit $pen = _GDIPlus_PenCreate(0xFF000000, 1) erstellst du den Stift und mit _GDIPlus_PenSetColor($pen, $c) kannst du die Farbe jeweils ändern ohne immer wieder ein Stift zu erstellen, das sonst Speicher fressen würde.

    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 24. Oktober 2009 um 15:06
    Zitat von simon

    Das mit transparenz ist auch cool !!!

    Hab mal eine Frage wie kann ich eine linie die ich erstellt habe in gdi farbig machen zb. Rot

    Bin gerade in einer Autowerkstatt und kann dir kein Beispiel schreiben. Hier ein Skript, das ich kürzlich einem MVP geschrieben habe.

    Vielleicht beantwortet es ja deine Frage:

    Spoiler anzeigen
    [autoit]


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

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

    Global Const $width = 640
    Global Const $height = 480
    Global $graphics, $backbuffer, $bitmap, $Pen, $i, $pi_div_180 = 4 * ATan(1) / 180

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

    Global $title = "GDI+ Color Gradient"

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1) ;, BitOR($WS_SYSMENU,$WS_DLGFRAME,$WS_POPUP))
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetState()

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    $pen = _GDIPlus_PenCreate(0xFF000000, 1)

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

    ;you can move this lines below until Do...Until loop to Do...Until loop and make some realtime effects
    $r = 0x00
    $g = 0x00
    $b = 0xFF
    $c = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    $i = 255 / $width

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

    _GDIPlus_GraphicsClear($backbuffer)

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

    For $x = 0 To $width
    _GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen)
    _GDIPlus_PenSetColor($pen, $c)
    $r += $i
    $g += $i
    $c = "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    Next

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

    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    GUIRegisterMsg(0xF, "MY_PAINT"); Register PAINT-Event 0x000F = $WM_PAINT (WindowsConstants.au3)
    GUIRegisterMsg(0x85, "MY_PAINT"); $WM_NCPAINT = 0x0085 (WindowsConstants.au3)Restore after Minimize.

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

    $b = 0

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

    Do

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

    Until False * Not Sleep(30)

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

    ;Func to redraw on PAINT MSG
    Func MY_PAINT($hWnd, $msg, $wParam, $lParam)
    ; The sequencial order of these two commands is important.
    _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0)
    _WinAPI_RedrawWindow($hwnd, "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME)); , $RDW_ALLCHILDREN
    Return $GUI_RUNDEFMSG
    EndFunc ;==>MY_PAINT

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

    Func Close()
    _GDIPlus_PenDispose($pen)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc

    [/autoit]

    Es zeichnet einen Farbverlauf in eine GUI inkl. Double Buffering, was aber eigentlich nicht benötigt wird.

    Bis später.

    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 23. Oktober 2009 um 14:43

    Also, ich persönlich würde mich nicht als GDI+ Meister, Guru oder wie auch immer bezeichnen! Da kenne ich viiiieeelll bessere Personen, wo ich sage, die sind wahre GDI+ Meister.

    Was ich im Prinzip immer mache, sind die GDI+ Grundfunktionen mit ein bissl Mathe zu mischen und das ist eigentlich keine meisterreife Leistung!

    Ferner finde die alles um 2D/3D sehr interessant, was aber eine brotlose Kunst ist. Es sei denn, man macht es professionell, aber dazu fehlt mir die Mathematik und die Zeit es zu erlernen!

    Der C64 hat mich auch in diese Richtung geprägt...


    Danke für das Feedback.


    Gruß,
    UEZ

  • GDI+: Rotating Letters

    • UEZ
    • 23. Oktober 2009 um 13:45

    Hier ein weiteres, sinnloses Skript:


    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2009

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

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>
    #include <GDIPlus.au3>
    #include <String.au3>

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

    Global Const $width = 640
    Global Const $height = 480
    Global Const $pi_div_180 = 4 * ATan(1) / 180
    Global $graphics, $backbuffer, $bitmap, $Pen, $arrTxt1, $arrTxt2, $fontsize_txt1, $fontsize_txt2
    Global $brush_color, $hFamily1, $hFamily2, $hFont1, $hFont2, $hFormat, $tLayout
    Global $x1, $x2, $y1, $y2, $a, $b, $c, $r, $g, $b
    Global $i = 0, $j = 360, $m = 0, $n = 0
    Global $radius_x, $radius_y
    Global $title = "GDI+: Rotating Letters by UEZ 2009!"

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, BitOR($WS_SYSMENU, $WS_DLGFRAME, $WS_POPUP))
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetState()

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2)

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

    $fontsize_txt1 = 48
    $fontsize_txt2 = 24

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

    $width_mul_045 = $width * 0.45
    $height_mul_045 = $height * 0.45
    $radius_x1 = ($width_mul_045) * 0.95
    $radius_y1 = ($height_mul_045) * 0.95
    $radius_x2 = ($width_mul_045) * 0.45
    $radius_y2 = ($height_mul_045) * 0.45
    $text1 = _StringReverse(" Rotating Letters using GDI+")
    $text2 = " By UEZ '09 ;-)"
    $arrTxt1 = StringSplit($text1, "")
    $arrTxt2 = StringSplit($text2, "")
    Dim $arrX1[UBound($arrTxt1)]
    Dim $arrY1[UBound($arrTxt1)]
    Dim $arrX2[UBound($arrTxt2)]
    Dim $arrY2[UBound($arrTxt2)]
    Dim $brush1[UBound($arrTxt1)]
    Dim $brush2[UBound($arrTxt2)]

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

    $r = 1
    $c = (255 / UBound($arrTxt1) - 1) * 2 - 1
    $r = 0x80
    $g = 0xA0
    $b = $c
    For $k = 0 To UBound($arrTxt1) - 1
    $brush_color = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    $brush1[$k] = _GDIPlus_BrushCreateSolid($brush_color)
    If $r = 1 Then
    $b += $c
    Else
    $b -= $c
    EndIf
    If $b >= 255 Then $r = 0
    If $b <= $c Then $r = 1
    Next

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

    For $k = 0 To (UBound($arrTxt2) - 1)
    $brush_color = 0xFF808080
    $brush2[$k] = _GDIPlus_BrushCreateSolid($brush_color)
    Next
    _GDIPlus_BrushSetSolidColor($brush2[0], 0xFFD08020)
    _GDIPlus_BrushSetSolidColor($brush2[1], 0xFFFFA060)
    _GDIPlus_BrushSetSolidColor($brush2[2], 0xFFD08020)

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

    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily1 = _GDIPlus_FontFamilyCreate("Arial")
    $hFamily2 = _GDIPlus_FontFamilyCreate("Comic Sans MS")
    $hFont1 = _GDIPlus_FontCreate($hFamily1, $fontsize_txt1, 2)
    $hFont2 = _GDIPlus_FontCreate($hFamily2, $fontsize_txt2, 2)
    $tLayout = _GDIPlus_RectFCreate(0, 0)
    $a = 360 / (UBound($arrTxt1) - 1)
    $b = 360 / (UBound($arrTxt2) - 1)
    $y = 0
    Do
    _GDIPlus_GraphicsClear($backbuffer, 0x90000000)
    For $x = 1 To UBound($arrTxt1) - 1
    $x1 = $width_mul_045 + Cos(($i + $m) * $pi_div_180) * $radius_x1
    $y1 = $height_mul_045 + Sin(($i + $m) * $pi_div_180) * $radius_y1 - $fontsize_txt1 / 4
    $arrX1[$x] = $x1
    $arrY1[$x] = $y1
    DllStructSetData($tLayout, "x", $arrX1[$x])
    DllStructSetData($tLayout, "y", $arrY1[$x])
    _GDIPlus_GraphicsDrawStringEx($backbuffer, $arrTxt1[$x], $hFont1, $tLayout, $hFormat, $brush1[$x])
    $m += $a
    Next
    For $x = 1 To UBound($arrTxt2) - 1
    $x2 = $width_mul_045 + Cos(($j + $n) * $pi_div_180) * $radius_x2 * Cos($y * $pi_div_180)
    $y2 = $height_mul_045 + Sin(($j + $n) * $pi_div_180) * $radius_y2 - $fontsize_txt2 / 4
    $arrX2[$x] = $x2
    $arrY2[$x] = $y2
    DllStructSetData($tLayout, "x", $arrX2[$x])
    DllStructSetData($tLayout, "y", $arrY2[$x])
    _GDIPlus_GraphicsDrawStringEx($backbuffer, $arrTxt2[$x], $hFont2, $tLayout, $hFormat, $brush2[$x])
    $n += $b
    Next
    If Mod($y, 2) = 1 Then Array_Rot($brush2, 1)
    $y += 1
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    $i += 1
    If $i >= 360 Then
    $i = 0
    $m = 0
    EndIf
    $j -= 2
    If $j <= 0 Then
    $j = 360
    $n = 0
    EndIf
    Until False * Not Sleep(30)

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

    Func Array_Rot(ByRef $arr, $dir = 0) ;0 for left, 1 for right
    Local $tmp, $p,$q
    If $dir = 0 Then ;left rotation
    $tmp = $arr[0]
    $q = 0
    For $p = 1 To UBound($arr) - 1
    $arr[$q] = $arr[$p]
    $q += 1
    Next
    $arr[UBound($arr) - 1] = $tmp
    ElseIf $dir = 1 Then ;right rotation
    $tmp = $arr[UBound($arr) - 1]
    $q = UBound($arr) - 1
    For $p = UBound($arr) - 2 To 0 Step - 1
    $arr[$q] = $arr[$p]
    $q -= 1
    Next
    $arr[0] = $tmp
    EndIf
    EndFunc

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

    Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
    Local $aResult
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "hwnd", $hBrush, "int", $iARGB)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc ;==>_GDIPlus_BrushSetSolidColor

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

    Func Close()
    For $x = 0 To UBound($arrTxt1) - 1
    _GDIPlus_BrushDispose($brush1[$x])
    Next
    For $x = 0 To UBound($arrTxt2) - 1
    _GDIPlus_BrushDispose($brush2[$x])
    Next
    _GDIPlus_FontDispose($hFont1)
    _GDIPlus_FontDispose($hFont2)
    _GDIPlus_FontFamilyDispose($hFamily1)
    _GDIPlus_FontFamilyDispose($hFamily2)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc ;==>Close

    [/autoit]


    Transparent Fenster Version (danke an Malkey (einer der wirklichen GDI+ Meister!)):

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2009
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    ;~ #AutoIt3Wrapper_Run_After=upx.exe --best "%out%"
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%" ;very slow
    #AutoIt3Wrapper_Run_After=del "Rotating Letters Transparent_Obfuscated.au3"

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

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>
    #include <GDIPlus.au3>
    #include <String.au3>

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

    Global Const $width = 640
    Global Const $height = 480
    Global Const $pi_div_180 = 4 * ATan(1) / 180
    Global $graphics, $backbuffer, $bitmap, $Pen, $arrTxt1, $arrTxt2, $fontsize_txt1, $fontsize_txt2
    Global $brush_color, $hFamily1, $hFamily2, $hFont1, $hFont2, $hFormat, $tLayout
    Global $ScreenDc, $dc, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend, $tPoint, $pPoint, $gdibitmap
    Global $x1, $x2, $y1, $y2, $a, $b, $c, $r, $g, $b
    Global $i = 0, $j = 360, $m = 0, $n = 0
    Global $radius_x, $radius_y
    Global $title = "GDI+: Rotating Letters by UEZ 2009!"

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

    Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo"
    ;Register callback
    $hKey_Proc = DllCallbackRegister("_Mouse_Proc", "int", "int;ptr;ptr")
    $hM_Module = DllCall("kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0)
    $hM_Hook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", $WH_MOUSE_LL, "ptr", DllCallbackGetPtr($hKey_Proc), "hwnd", $hM_Module[0], "dword", 0)

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

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")

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

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 2)

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

    $ScreenDc = _WinAPI_GetDC($hWnd)
    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)
    _WinAPI_SelectObject($dc, $gdibitmap)
    ; _WinAPI_UpdateLayeredWindow parameters
    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $width)
    DllStructSetData($tSize, "Y", $height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    Global $alpha = 200
    Global $alpha_steps = 5
    DllStructSetData($tBlend, "Alpha", $alpha)
    DllStructSetData($tBlend, "Format", 1)
    $tPoint = DllStructCreate($tagPOINT)
    $pPoint = DllStructGetPtr($tPoint)
    DllStructSetData($tPoint, "X", 0)
    DllStructSetData($tPoint, "Y", 0)

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

    GUISetState()

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

    $fontsize_txt1 = 48
    $fontsize_txt2 = 24

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

    $width_mul_045 = $width * 0.45
    $height_mul_045 = $height * 0.45
    $radius_x1 = ($width_mul_045) * 0.95
    $radius_y1 = ($height_mul_045) * 0.95
    $radius_x2 = ($width_mul_045) * 0.45
    $radius_y2 = ($height_mul_045) * 0.45
    $text1 = _StringReverse(" Rotating Letters using GDI+")
    $text2 = " By UEZ '09 ;-)"
    $arrTxt1 = StringSplit($text1, "")
    $arrTxt2 = StringSplit($text2, "")
    Dim $arrX1[UBound($arrTxt1)]
    Dim $arrY1[UBound($arrTxt1)]
    Dim $arrX2[UBound($arrTxt2)]
    Dim $arrY2[UBound($arrTxt2)]
    Dim $brush1[UBound($arrTxt1)]
    Dim $brush2[UBound($arrTxt2)]

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

    $r = 1
    $c = (255 / UBound($arrTxt1) - 1) * 2 - 1
    $r = 0x80
    $g = 0xA0
    $b = $c
    For $k = 0 To UBound($arrTxt1) - 1
    $brush_color = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)
    $brush1[$k] = _GDIPlus_BrushCreateSolid($brush_color)
    If $r = 1 Then
    $b += $c
    Else
    $b -= $c
    EndIf
    If $b >= 255 Then $r = 0
    If $b <= $c Then $r = 1
    Next

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

    For $k = 0 To (UBound($arrTxt2) - 1)
    $brush_color = 0xFF808080
    $brush2[$k] = _GDIPlus_BrushCreateSolid($brush_color)
    Next
    _GDIPlus_BrushSetSolidColor($brush2[0], 0xFFD08020)
    _GDIPlus_BrushSetSolidColor($brush2[1], 0xFFFFA060)
    _GDIPlus_BrushSetSolidColor($brush2[2], 0xFFD08020)

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

    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily1 = _GDIPlus_FontFamilyCreate("Arial")
    $hFamily2 = _GDIPlus_FontFamilyCreate("Comic Sans MS")
    $hFont1 = _GDIPlus_FontCreate($hFamily1, $fontsize_txt1, 2)
    $hFont2 = _GDIPlus_FontCreate($hFamily2, $fontsize_txt2, 2)
    $tLayout = _GDIPlus_RectFCreate(0, 0)
    $a = 360 / (UBound($arrTxt1) - 1)
    $b = 360 / (UBound($arrTxt2) - 1)
    $y = 0

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

    Do
    _GDIPlus_GraphicsClear($backbuffer, 0x00000000)
    For $x = 1 To UBound($arrTxt1) - 1
    $x1 = $width_mul_045 + Cos(($i + $m) * $pi_div_180) * $radius_x1
    $y1 = $height_mul_045 + Sin(($i + $m) * $pi_div_180) * $radius_y1 - $fontsize_txt1 / 4
    $arrX1[$x] = $x1
    $arrY1[$x] = $y1
    DllStructSetData($tLayout, "x", $arrX1[$x])
    DllStructSetData($tLayout, "y", $arrY1[$x])
    _GDIPlus_GraphicsDrawStringEx($backbuffer, $arrTxt1[$x], $hFont1, $tLayout, $hFormat, $brush1[$x])
    $m += $a
    Next
    For $x = 1 To UBound($arrTxt2) - 1
    $x2 = $width_mul_045 + Cos(($j + $n) * $pi_div_180) * $radius_x2 * Cos($y * $pi_div_180)
    $y2 = $height_mul_045 + Sin(($j + $n) * $pi_div_180) * $radius_y2 - $fontsize_txt2 / 4
    $arrX2[$x] = $x2
    $arrY2[$x] = $y2
    DllStructSetData($tLayout, "x", $arrX2[$x])
    DllStructSetData($tLayout, "y", $arrY2[$x])
    _GDIPlus_GraphicsDrawStringEx($backbuffer, $arrTxt2[$x], $hFont2, $tLayout, $hFormat, $brush2[$x])
    $n += $b
    Next
    If Mod($y, 2) = 1 Then Array_Rot($brush2, 1)
    $y += 1

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

    ;~ _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)

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

    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
    _WinAPI_DeleteObject($gdibitmap)
    $i += 1
    If $i >= 360 Then
    $i = 0
    $m = 0
    EndIf
    $j -= 2
    If $j <= 0 Then
    $j = 360
    $n = 0
    EndIf
    Until False * Not Sleep(30)

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

    Func Array_Rot(ByRef $arr, $dir = 0) ;0 for left, 1 for right
    Local $tmp, $p,$q
    If $dir = 0 Then ;left rotation
    $tmp = $arr[0]
    $q = 0
    For $p = 1 To UBound($arr) - 1
    $arr[$q] = $arr[$p]
    $q += 1
    Next
    $arr[UBound($arr) - 1] = $tmp
    ElseIf $dir = 1 Then ;right rotation
    $tmp = $arr[UBound($arr) - 1]
    $q = UBound($arr) - 1
    For $p = UBound($arr) - 2 To 0 Step - 1
    $arr[$q] = $arr[$p]
    $q -= 1
    Next
    $arr[0] = $tmp
    EndIf
    EndFunc

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

    ;http://www.autoitscript.com/forum/index.php?showtopic=81761
    Func _Mouse_Proc($nCode, $wParam, $lParam) ;function called for mouse events.. Made by _Kurt
    ;define local vars
    Local $info, $mouseData

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

    If $nCode < 0 Then ;recommended, see http://msdn.microsoft.com/en-us/library/ms644986(VS.85).aspx
    $ret = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hM_Hook[0], "int", $nCode, "ptr", $wParam, "ptr", $lParam) ;recommended
    Return $ret[0]
    EndIf
    $info = DllStructCreate($MSLLHOOKSTRUCT, $lParam)
    $mouseData = DllStructGetData($info, 3)

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

    ;Find which event happened
    Select
    Case $wParam = $WM_MOUSEWHEEL And WinActive($hwnd)
    If _WinAPI_HiWord($mouseData) > 0 Then ;wheel up
    If $alpha + $alpha_steps <= 512 Then $alpha += $alpha_steps
    Switch $alpha
    Case 0 To 255
    DllStructSetData($tBlend, "Alpha", $alpha)
    DllStructSetData($tBlend, "Format", 1)
    Case 256 To 512
    DllStructSetData($tBlend, "Alpha", $alpha - 256)
    DllStructSetData($tBlend, "Format", 0)
    EndSwitch
    Else ;wheel down
    If $alpha - $alpha_steps > 0 Then $alpha -= $alpha_steps
    Switch $alpha
    Case 0 To 255
    DllStructSetData($tBlend, "Alpha", $alpha) ;wheel up
    DllStructSetData($tBlend, "Format", 1)
    Case 256 To 512
    DllStructSetData($tBlend, "Alpha", $alpha - 256) ;wheel up
    DllStructSetData($tBlend, "Format", 0)
    EndSwitch
    EndIf
    ConsoleWrite($alpha & @CRLF)
    EndSelect

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

    ;This is recommended instead of Return 0
    $ret = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hM_Hook[0], "int", $nCode, "ptr", $wParam, "ptr", $lParam)
    Return $ret[0]
    EndFunc ;==>_Mouse_Proc

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

    Func Close()
    DllCall("user32.dll", "int", "UnhookWindowsHookEx", "hwnd", $hM_Hook[0])
    $hM_Hook[0] = 0
    DllCallbackFree($hKey_Proc)
    $hKey_Proc = 0
    For $x = 0 To UBound($arrTxt1) - 1
    _GDIPlus_BrushDispose($brush1[$x])
    Next
    For $x = 0 To UBound($arrTxt2) - 1
    _GDIPlus_BrushDispose($brush2[$x])
    Next
    _WinAPI_DeleteDC($dc)
    _WinAPI_ReleaseDC($hWnd, $ScreenDc)
    _GDIPlus_FontDispose($hFont1)
    _GDIPlus_FontDispose($hFont2)
    _GDIPlus_FontFamilyDispose($hFamily1)
    _GDIPlus_FontFamilyDispose($hFamily2)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_Shutdown()
    WinClose($hwnd)
    Exit
    EndFunc ;==>Close

    [/autoit]

    Gruß,
    UEZ

    PS: falls ihr WinXP benutzt und die Darstellung sehr, sehr langsam ist, dann die Zeile 91: _GDIPlus_GraphicsClear($backbuffer, 0x90000000) durch _GDIPlus_GraphicsClear($backbuffer, 0xFF000000) ersetzen (gilt nur für nicht transparente Version)!!!

    Dateien

    Rotating Letters Transparent.au3 8,77 kB – 678 Downloads Rotating Letters.au3 5,59 kB – 785 Downloads
  • Programm zählt falsch

    • UEZ
    • 23. Oktober 2009 um 00:30

    Ich habe ein wenig dein Skript umgestaltet!

    Ich hoffe, dass ist das, was du willst.

    Gruß,
    UEZ

    Dateien

    Datei.zip 1,77 kB – 436 Downloads

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™