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 + Hilfe

    • UEZ
    • 14. Oktober 2010 um 19:08

    Sag' mal, benutzt du Google Translator?

    Gruß,
    UEZ

  • GUIGetMsg bei GDIPlus Grafik

    • UEZ
    • 10. Oktober 2010 um 20:32

    Kannst ja mal hier reinschauen: http://www.autoitscript.com/forum/index.php?showtopic=120384

    Gruß,
    UEZ

  • Hilfe bei sleep

    • UEZ
    • 10. Oktober 2010 um 15:32

    Eine andere Möglichkeit ist Adlib:

    Spoiler anzeigen
    [autoit]


    #include <File.au3>
    #include <Array.au3>
    #include <GUIConstants.au3>
    $pic = 0
    $width = 375
    $height = 354
    $time = 3000
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", $width,$height, 223, 148)
    $Slider1 = GUICtrlCreateSlider(70,310,209,40)
    GUICtrlSetLimit($slider1, 18000,3000)
    GUICtrlSetData($slider1, $time)
    $stop = GUICtrlCreateButton("Stop",340,315)
    $Start = GUICtrlCreateButton("Start",300,315)
    GUISetBkColor(0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $height -= 50
    $path = "..\Images\"
    $pics = _FileListToArray($path,"*.jpg",1)

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

    While 1

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

    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    AdlibUnRegister("Diashow")
    Exit
    Case $nMsg = $stop
    AdlibUnRegister("Diashow")
    Case $nMsg = $start
    $time = GUICtrlRead($Slider1)
    AdlibRegister("Diashow", $time)
    Case $nMsg = $Slider1
    $time = GUICtrlRead($Slider1)
    AdlibUnRegister("Diashow")
    AdlibRegister("Diashow", $time)
    ConsoleWrite($time & @CRLF)
    EndSelect
    WEnd

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

    Func Diashow()
    GUICtrlDelete($pic)
    $bild = Random(1,$pics[0],1)
    ;ConsoleWrite($pics[1])
    ;ConsoleWrite($bild)
    $i = $bild
    $pic = GUICtrlCreatePic ( $path & $pics[$i], 1, 1,$width,$height)
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • _IE bzw GDIPlus Problem

    • UEZ
    • 8. Oktober 2010 um 23:26

    Bei mir wird das Rechteck irgendwo plaziert. Abgesehen davon, kann ich da mal schauen, ob ich die bei den GDI+ Sachen helfen kann!

    Gruß,
    UEZ

  • _IE bzw GDIPlus Problem

    • UEZ
    • 8. Oktober 2010 um 23:19

    Das Problem ist nicht GDI+, sondern die Berechnung der Koodinate für das Rechteck. Natürlich kann man auch noch zusätzlich GDI+ optimieren, aber zunächst sollte die Berechnung klappen.

    Da ich so gut wie nie mit den IE.au3 gearbeitet habe, weiß ich nicht, wie man vernünftig die Position berechnet, denn bei mir wird das Rechteck irgendwo platziert.

    Gruß,
    UEZ

  • SaveBitmap

    • UEZ
    • 8. Oktober 2010 um 19:11

    Ich habe auch aus der Idee eine UDF gebastelt.

    Vielleicht nützt es ja jemanden...

    Den Pfad im Beispiel 1 zur Bitmap Datei muss noch manuell angepasst werden.

    Umgezogen: Write Text on Bitmap v0.90 Build 2011-03-23 Beta

    Gruß,
    UEZ

  • au3Irr2 (Irrlicht 3D-Engine und autoIt)

    • UEZ
    • 8. Oktober 2010 um 16:53

    Ich weiß und du bist "voll" dabei. ;)

    Gruß,
    UEZ

  • GDI+ Pixel Text Effect Beta Build 2010-10-21

    • UEZ
    • 8. Oktober 2010 um 00:28

    Habe noch ein paar kleine Effekte hinzugefügt (siehe Post#1). 8)

    Gruß,
    UEZ

  • GDI+ Buffer einbauen

    • UEZ
    • 6. Oktober 2010 um 21:55

    Bei mir geht's!

    Check mal den Pfad zu den Bildern!

    Gruß,
    UEZ

  • GDI+ Buffer einbauen

    • UEZ
    • 6. Oktober 2010 um 21:47

    So müsste es rein theoretisch gehen:

    Spoiler anzeigen
    [autoit]


    #include <GuiConstants.au3>
    #include <GdiPlus.au3>;das include
    #include <Misc.au3>

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

    OnAutoItExitRegister("_end") ; die Funktion _end am Ende des Scriptes ausführen

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

    $x = 0; Poition von Bild auf X-Achse
    $y = 0; Poition von Bild auf Y-Achse

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

    $Gui = GUICreate("Beispiel", 179, 163, 100, 100); GUI erstellen
    GUISetState(@SW_SHOW); Anzeigen

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

    _GDIPlus_Startup() ;Gdi starten

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

    $figur = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\tux.jpg"); Meine Bild reinladen
    $background = _GDIPlus_ImageLoadFromFile(@ScriptDIr & "\al.png")
    $height = _GDIPlus_ImageGetHeight($figur); Größe meines Bildes ermitteln (Höhe)
    $width = _GDIPlus_ImageGetWidth($figur); Größe meines Bildes ermitteln (Breite)
    $verhaelnis = $height / $width; Verhältnis ausrechen, damit kleiner
    $graphic = _GDIPlus_GraphicsCreateFromHWND($Gui); Object um drauf zu malen
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphic) ;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) ; da

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE ; Event CLose
    Exit

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

    EndSwitch

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

    Select
    Case _IsPressed(25); Links pfeiltaste änder die koordinaten so, dass bild sich nach links bewegt!
    $x -= 1
    Case _IsPressed(26); Oben pfeiltaste änder die koordinaten so, dass bild sich nach oben bewegt!
    $y -= 1
    Case _IsPressed(27); Rechts pfeiltaste änder die koordinaten so, dass bild sich nach rechts bewegt!
    $x += 1
    Case _IsPressed(28); Runter pfeiltaste änder die koordinaten so, dass bild sich nach unten bewegt!
    $y += 1
    EndSelect
    _GDIPlus_GraphicsDrawImageRect($backbuffer,$background,0,0,179,163)
    _GDIPlus_GraphicsDrawImageRect($backbuffer, $figur, $x, $y, 20,20 * $verhaelnis) ;die Figur wird an der neuen Position gezeichnet
    ;($graphic = Unser Hintergrund also Wodrauf er neuzeichnen soll)
    ;($figur= Was er neuzeichnen soll also unser Bild!)
    ;($x= Die veränderte X Koordinate)
    ;($y= Die veränderte Y Koordinate)
    ;(20 = Die Größe(Weite!) )
    ;(20 *$verhaelnis = Die größe(Höhe))
    _GDIPlus_GraphicsDrawImageRect($graphic, $bitmap, 0, 0, 179,163)
    WEnd

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

    Func _end();die Exit funktion
    _GDIPlus_GraphicsDispose($graphic);Grafik Objekt freigeben
    _GDIPlus_ImageDispose($figur);Bild Objekt freigeben
    ; _GDIPlus_GraphicsDispose($backbuffer)
    ; _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_ImageDispose($background);Bild Objekt freigeben
    _GDIPlus_Shutdown();Ressourcen freigeben
    EndFunc ;==>_end

    [/autoit]

    Gruß,
    UEZ

  • Gleichung gesucht.

    • UEZ
    • 4. Oktober 2010 um 22:53

    Bitte sehr!

    Spoiler anzeigen
    [autoit]


    #include <String.au3>
    $zahlen = ""
    $zahl = 2047

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

    $t = TimerInit()
    $len = StringLen(Integer2Binary($zahl, 0))

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

    For $i = 0 To $zahl
    $zahlen &= Integer2Binary($i, $len) & @CRLF
    Next
    ConsoleWrite("Laufzeit: " & Round(TimerDiff($t), 2) & " ms." & @CRLF)
    $hFile = FileOpen("Zählen.txt", 2)
    FileWrite($hFile, $zahlen)
    FileClose($hFile)
    Exit

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

    Func Integer2Binary($int, $stellen = 11)
    Local $bin, $null
    If Not IsFloat($int) And Not IsString($int) And $int >= 0 Then
    While $int >0
    $bin &= Mod($int, 2)
    $int = Floor($int / 2)
    WEnd
    SetError(0)
    For $i = 1 To $stellen - StringLen($bin)
    $null &= 0
    Next
    Return($null & _StringReverse($bin))
    Else
    SetError(1)
    Return "Error"
    EndIf
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Suche eine GDi+ Profi, der mit erklären kann wie man ein Bitmap beschriftet.

    • UEZ
    • 4. Oktober 2010 um 22:39
    Zitat von Raupi

    Ineluki, dein Script funzt soweit.

    UEZ, dein Beispiel ist perfekt. Voralledingen die Fontgröße und Positionierung.

    Hab aber jetzt mal eine Frage dazu. Braucht man die GUI dazu überhaupt?
    Irgendwie kapiere ich nicht für was ein Bitmap von der GUI ertstellt werden muß.
    Kann man das nicht direkt machen?


    Kannst ja daraus eine Funktion basteln ;)

    Spoiler anzeigen
    [autoit]


    ;Fast hack by UEZ 2010 ;)
    #include <GDIPlus.au3>
    Opt('MustDeclareVars', 1)
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    Local $hBild = _GDIPlus_ImageLoadFromFile("Button1.bmp")
    Local $iX = _GDIPlus_ImageGetWidth($hBild)
    Local $iY = _GDIPlus_ImageGetHeight($hBild)

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

    Local $text = "Beispieltext"

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

    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iX, $iY)
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hContext, 2)

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

    Local $hPinsel = _GDIPlus_BrushCreateSolid (0xFFFFFFFF)
    Local $hFormat = _GDIPlus_StringFormatCreate ()
    Local $hFamily = _GDIPlus_FontFamilyCreate ("Arial")
    Local $font_size = Floor(($iX - StringLen($text)) / 10)
    Local $hFont = _GDIPlus_FontCreate ($hFamily, $font_size, 0)
    Local $tLayout = _GDIPlus_RectFCreate (0, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString ($hContext, $text, $hFont, $tLayout, $hFormat)

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

    _GDIPlus_GraphicsDrawImageRect($hContext, $hBild, 0, 0, $iX, $iY)

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

    Local $fWidth = DllStructGetData($aInfo[0], "Width")
    Local $fHeight = DllStructGetData($aInfo[0], "Height")

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

    DllStructSetData($tLayout, "x", $iX / 2 - Round($fWidth / 2, 0))
    DllStructSetData($tLayout, "y", $iY / 2 - Round($fHeight / 2, 0) - 2)

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

    _GDIPlus_GraphicsDrawStringEx ($hContext, $text, $hFont, $tLayout, $hFormat, $hPinsel)

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

    _Exit()

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

    Func _Exit()
    _GDIPlus_ImageSaveToFile($hBitmap, "Button1+.bmp")
    _GDIPlus_ImageDispose($hBild)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hPinsel)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[6]
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Suche eine GDi+ Profi, der mit erklären kann wie man ein Bitmap beschriftet.

    • UEZ
    • 4. Oktober 2010 um 21:25

    Meinst du so was?

    Spoiler anzeigen
    [autoit]


    ;Fast hack by UEZ 2010 ;)
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>

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

    Opt('MustDeclareVars', 1)
    Opt("GUIOnEventMode", 1)

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

    _GDIPlus_Startup()
    Local $hBild = _GDIPlus_ImageLoadFromFile("Button1.bmp")
    Local $iX = _GDIPlus_ImageGetWidth($hBild)
    Local $iY = _GDIPlus_ImageGetHeight($hBild)

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

    Local $hGUI = GUICreate("GDI+ Raupi", $iX, $iY)
    GUISetState()

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

    Local $text = "Beispieltext"

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

    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphic)
    Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    Local $hPinsel = _GDIPlus_BrushCreateSolid (0xFFFFFFFF)
    Local $hFormat = _GDIPlus_StringFormatCreate ()
    Local $hFamily = _GDIPlus_FontFamilyCreate ("Arial")
    Local $font_size = Floor(($iX - StringLen($text)) / 10)
    Local $hFont = _GDIPlus_FontCreate ($hFamily, $font_size, 0)
    Local $tLayout = _GDIPlus_RectFCreate (0, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString ($hGraphic, $text, $hFont, $tLayout, $hFormat)

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

    _GDIPlus_GraphicsDrawImageRect($hContext, $hBild, 0, 0, $iX, $iY)

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

    Local $fWidth = Floor(DllStructGetData($aInfo[0], "Width"))
    Local $fHeight = Floor(DllStructGetData($aInfo[0], "Height"))

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

    DllStructSetData($tLayout, "x", $iX / 2 - $fWidth / 2)
    DllStructSetData($tLayout, "y", $iY / 2 - $fHeight / 2 - 2)

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

    _GDIPlus_GraphicsDrawStringEx ($hContext, $text, $hFont, $tLayout, $hFormat, $hPinsel)

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

    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iX, $iY)

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    While Sleep(1000)
    WEnd

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

    Func _Exit()
    _GDIPlus_ImageSaveToFile($hBitmap, "Button1+.bmp")
    _GDIPlus_ImageDispose($hBild)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hPinsel)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Binary/Whitespace/NullBytes Problemchen

    • UEZ
    • 3. Oktober 2010 um 18:18

    Hier meine Version:

    [autoit]


    #Include <String.au3>
    $soll = "ÿÿÿÿÿÿÿÿÿÿinfo0.5.1 unnamed server dm1 DM 0 -1 0 8 "
    $binray = "0xFFFFFFFFFFFFFFFFFFFF696E666F302E352E3100756E6E616D65642073657276657200646D3100444D0030002D310030003800"
    $filter = "0x" & _StringReverse(StringRegExpReplace(_StringReverse(StringMid($binray, 3)), "(?i)(00)", "02"))
    $ist = BinaryToString($filter)
    ;~ $read = FileRead("info.txt")
    ;~ MsgBox(0,"Sollte/Ist-Vergleich","ÿÿÿÿÿÿÿÿÿÿinfo0.5.1 unnamed server dm1 DM 0 -1 0 8 " & @CRLF & $read)
    MsgBox(0,"Sollte/Ist-Vergleich", $soll & @CRLF & $ist)

    [/autoit]

    Gruß,
    UEZ

  • Auflösung wiedergeben

    • UEZ
    • 3. Oktober 2010 um 15:37
    [autoit]


    #include <GDIPlus.au3>
    _GDIPlus_Startup()
    $Datei = FileOpenDialog("Bitte ein Bild aussuchen", "", "Bilder (*.jpg;*.png;*.bmp)")
    If @error Then Exit
    $Bild = _GDIPlus_ImageLoadFromFile($Datei)
    $iX = _GDIPlus_ImageGetWidth($Bild)
    $iY = _GDIPlus_ImageGetHeight($Bild)
    _GDIPlus_ImageDispose($Bild)
    _GDIPlus_ShutDown()
    MsgBox(0, "Bild Auflösung", $Datei & " hat eine Auflösung von :" & @CRLF & @CRLF & $iX & " x " & $iY & " Pixel.")
    Exit

    [/autoit]


    Gruß,
    UEZ

  • GDI+ Pixel Text Effect Beta Build 2010-10-21

    • UEZ
    • 2. Oktober 2010 um 23:03

    Es gibt kein Copyright auf meine veröffentlichten Source Codes. Jeder darf die Sources verwenden und auch modifizieren, nur würde ich gerne in den Credits auftauchen. ;)

    Gruß,
    UEZ

  • Audio Visualization Collection

    • UEZ
    • 2. Oktober 2010 um 14:01

    Schade, dass es nur sehr wenig Feedback gibt. ;(

    Nach meiner Meinung ist das, was hier von eukalyptus geboten wird, GDI+ Coding Crème de la Crème - absolut top! :thumbup:

    Gruß,
    UEZ

  • GDI+ Pixel Text Effect Beta Build 2010-10-21

    • UEZ
    • 2. Oktober 2010 um 11:39

    Ich habe jetzt den Code aktualisiert u.a. mit dem Vorschlag von eukalyptus! Ihr könnt ja mal testen, ob diese Version unter Windows XP besser läuft!

    Natürlich liegt es in der Natur von AutoIt ab einer bestimmten Anzahl von Pixel langsamer zu laufen (abhängig von der CPU)...

    Ich persönlich habe keinen Unterschied auf Vista x32 gesehen, aber wenn diese Version "flüssiger" unter WinXP läuft, dann um so besser!

    Vielen Dank für die Kommentare!


    Gruß,
    UEZ

  • SplashTextOn

    • UEZ
    • 1. Oktober 2010 um 20:26
    [autoit]


    SplashTextOn("Test", "Hallo" & @CRLF & "Du" & @CRLF & "Da!", 70, 90, -1, -1, 1 + 32)

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

    Sleep(5000)

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

    SplashOff()

    [/autoit]

    Gruß,
    UEZ

  • Progessbar in neuem Gui-Fenster

    • UEZ
    • 1. Oktober 2010 um 19:39

    Ich glaube, du suchst so was:

    [autoit]


    ProgressOn("Progress Meter", "", "", -1, -1, 1 + 16)
    For $i = 10 to 100 step 10
    Sleep(1000)
    ProgressSet( $i, "")
    Next
    Sleep(500)
    ProgressOff()

    [/autoit]

    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™