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

  • Grafische Spielerei

    • UEZ
    • 10. August 2012 um 20:33

    Sieht auch cool aus: 904181+150+2025+159

    Gruß,
    UEZ

  • Grafische Spielerei

    • UEZ
    • 10. August 2012 um 18:04

    Sieht klasse aus! :thumbup:

    Gruß,
    UEZ

  • PNG Image Problem

    • UEZ
    • 9. August 2012 um 15:08

    Die anderen? Du meinst Dick & Doof...

    Gruß,
    UEZ

  • PNG Image Problem

    • UEZ
    • 9. August 2012 um 15:03

    Guckst du hier: http://www.autoitscript.com/forum/topic/14…440__hl__%2Buez

    Gruß,
    UEZ

  • Ressourcen Komprimieren

    • UEZ
    • 9. August 2012 um 09:40

    Bevor ich dein Skript teste, eine kleine Anmerkung zu 2.: die Ressource wird in ein Base64 umgewandelt, aber vorher, wenn erwünscht, mit dem Built-In Kerner32 Funktion komprimiert, so dass je nach Datentyp die Ressource noch kleiner wird.
    Aber du hast recht, dass nach der Komprimierung und Umwandlung in B64 die Zeichenfolgen noch verkleinerbar ist. Ok, das ist nicht dein Ansatz.

    Werde mal File to Base216 String Code Generator basteln und es mit
    File to Base64 String Code Generator vergleichen.

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 8. August 2012 um 09:56

    Klar kannst du den Code bearbeiten, modifizieren und daraus eine Exe machen. Ansonsten hätte ich den Source Code nicht gepostet. ;)

    Ich meine mit ControlSend kannst du auch arbeiten, ohne dass die GUI aktiv sein muss (arbeite kaum mit Automatisierungen mit den Send Befehlen).

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 7. August 2012 um 21:47
    Zitat von Ilse

    Hallo UEZ,

    hab ich gemacht, alle Fehler sind weg.
    Danke

    Mal ne Frage zu dem Programm und ein paar Problemchen...

    • Darf man das Programm so mitgeben?
    • Kann man z.B. mit Controlsend die Befehle im Hintergrund ausführen ohne daß man die Oberfläche sieht.
    • Kann man den Text zentrieren? Hab nichts gefunden.
    • Alt Tastaturabkürzungen für das Menü gehen nicht(z.B. Alt T für Text)


    Grüße Ilse ;)

    Wem willst du das Programm mitgeben? Es ist eigentlich ein Bestandteil von dem Screenshooter und so eigentlich nicht vollständig separat zu laufen. Eigentlich sollte es nur dir nützlich sein.
    Keine Ahnung, ob man mit Controlsend das Ding "kontrollieren" kann; einfach ausprobieren.
    Zentrieren ist nicht implementiert, kann es aber hinzufügen.
    Bezgl. der Tastenabkürzungen muss ich auch mal schauen.

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 7. August 2012 um 11:25

    Aktualisiere deine Version auf die Neuste, dann sollte es auch funzen.

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 6. August 2012 um 15:12

    Welche AutoIt Version benutzt du?

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 6. August 2012 um 14:06

    Hi Ilse,

    leider hatte ich keine Zeit was zu basteln. :(

    Ich habe mal den Basic Image Editor aus dem Windows Screenshooter extrahiert. Dort kannst du u.a. auch Texte auf das Bild zeichnen und rotieren (linke Maustaste gedrückt halten und Maus bewegen).

    Vielleicht hilft die das Ding weiter. Ich weiß, dass es für deine Zwecke überdimensioniert ist, aber was soll's...

    Gruß,
    UEZ

    Dateien

    Basic Image Editor.au3 124,51 kB – 240 Downloads
  • Autoit zu C++ konverter

    • UEZ
    • 5. August 2012 um 15:41

    Ok, vielleicht habe ich " Autoit zu c++ konverter" falsch verstanden.

    Was ist genau mit " Autoit zu c++ konverter" gemeint?

    Gruß,
    UEZ

  • GDI+ Spielerei: Rolle aus Rechtecken

    • UEZ
    • 4. August 2012 um 12:03

    Na ja, Off-Topic ist eher für Themen, die sonst nichts mit Coding zu tun haben. Egal wie "klein" dein Beispiel Skript ist, sollte aber in Skripte liegen. ;)

    Gruß,
    UEZ

  • GDI+ Spielerei: Rolle aus Rechtecken

    • UEZ
    • 3. August 2012 um 01:05
    Zitat von Marsi


    ...
    Die Idee habe ich von einer alten Demo (sowas wie die 64k Demos usw).
    Hier ein Beispiel dazu: http://www.stpe.se/javascript/rasterbar.php
    ...

    Ich hatte ein bissl Zeit und habe mal das JavaScript portiert:

    Spoiler anzeigen
    [autoit]


    ;coded by UEZ 2012 build 2012-08-03
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Tidy_Stop_OnError=n
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--best --lzma
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    #include <Array.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    Opt('GUIOnEventMode', 1)
    Opt("MustDeclareVars", 1)

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

    _GDIPlus_Startup()
    Global Const $iW = 640, $iH = 480
    Global $sGUIText = "Rotating Raster Bars (C64 Style) by UEZ 2012 / FPS: "
    Global Const $hGUI = GUICreate($sGUIText, 640, 480)
    GUISetState()

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

    #region init GDI+
    Global Const $hBitmap = _WinAPI_CreateDIB($iW, $iH)
    Global Const $hDC = _WinAPI_GetDC($hGUI)
    Global Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC)
    Global Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hBitmap)
    Global Const $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer)
    Global Const $hBrush = _GDIPlus_BrushCreateSolid(0x40000000)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
    #endregion
    Global Const $fPI = ACos(-1)
    Global Const $f2PI = 2 * ACos(-1)
    Global Const $fRad = ACos(-1) / 180
    Global Const $fYPos = $iH / 2
    Global Const $fSpeed = 0.3
    Global Const $fRadius = 150
    Global Const $fZSize = 20
    Global Const $iSize = 100, $iS2 = $iSize / 2
    Global $aBitmaps[3][4], $e, $r, $j, $k, $l , $z = 0, $iFPS = 0
    Global $iUb = UBound($aBitmaps) - 1

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

    For $e = 0 To $iUb
    $r = Random(3, 12, 1)
    $aBitmaps[$e][0] = CreateBar($r, $iW, $iSize, "0xFF" & Hex(Random(0x0, 0xFFFFFF, 1), 6))
    $aBitmaps[$e][1] = $fYPos
    $aBitmaps[$e][2] = Sin($e * $fRad) * 360 / ($iUb + 1)
    Next

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

    GUISetOnEvent($GUI_EVENT_CLOSE , "_Exit")
    AdlibRegister("FPS", 1000)

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

    While Sleep(10)
    DllCall($ghGDIPDll, "int", "GdipFillRectangleI", "handle", $hGraphic, "handle", $hBrush, "int", 0, "int", 0, "int", $iW, "int", $iH) ;_GDIPlus_GraphicsFillRect()
    For $j = 0 To $iUb
    $k = Sin($fRad * $z + $aBitmaps[$j][2]) * $fRadius
    $aBitmaps[$j][3] = Cos(-270 + $fRad * $z + $aBitmaps[$j][2])
    $aBitmaps[$j][1] = $fYPos + $k - $iS2
    DllCall($ghGDIPDll, "int", "GdipDrawImageRect", "handle", $hGraphic, "handle", $aBitmaps[$j][0], "float", 0, "float", $aBitmaps[$j][1], "float", $iW, "float", $iSize + $aBitmaps[$j][3] * $fZSize)
    $z += $fSpeed
    Next
    _ArraySort($aBitmaps, 0, 0, 0, 3)
    DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) ;_WinAPI_BitBlt()
    $iFPS += 1
    WEnd

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

    Func CreateBar($iStep, $iW, $iH, $iColor, $iBoost = 3)
    Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    Local Const $hBitmap = $aResult[6]
    Local Const $hCtx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Local Const $hBrush = _GDIPlus_BrushCreateSolid(0x00000000)
    Local $i, $y = 0
    For $x = 0 To $iH / 2 Step $iStep
    _GDIPlus_BrushSetSolidColor($hBrush, CalcColor($iColor, $iBoost * $x))
    _GDIPlus_GraphicsFillRect($hCtx, 0, $y, $iW, $iStep, $hBrush)
    $y += $iStep
    Next
    For $x = $iH / 2 - $iStep To 0 Step -$iStep
    _GDIPlus_BrushSetSolidColor($hBrush, CalcColor($iColor, $iBoost * $x))
    _GDIPlus_GraphicsFillRect($hCtx, 0, $y, $iW, $iStep, $hBrush)
    $y += $iStep
    Next
    _GDIPlus_GraphicsDispose($hCtx)
    _GDIPlus_BrushDispose($hBrush)
    Return $hBitmap
    EndFunc

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

    Func CalcColor($iColor, $iStep)
    Local Const $iA = Hex(BitAND(0xFF, BitShift($iColor, 24)), 2)
    Local Const $iR = Hex(Min(BitAND(0xFF, BitShift($iColor, 16)) + Int($iStep), 0xFF), 2)
    Local Const $iG = Hex(Min(BitAND(0xFF, BitShift($iColor, 8)) + Int($iStep), 0xFF), 2)
    Local Const $iB = Hex(Min(BitAND(0xFF, $iColor) + Int($iStep), 0xFF), 2)
    Return "0x" & $iA & $iR & $iG & $iB
    EndFunc

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

    Func FPS()
    WinSetTitle("", "", $sGUIText & $iFPS)
    $iFPS = 0
    EndFunc

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

    Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
    EndFunc

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

    Func _Exit()
    AdlibUnRegister("FPS")
    Local $c
    For $c = 0 To UBound($aBitmaps) - 1
    _GDIPlus_BitmapDispose($aBitmaps[$c][0])
    Next
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _WinAPI_SelectObject($hDC, $DC_obj)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_ReleaseDC($hGUI, $hDC)

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

    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

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

    Func _WinAPI_CreateDIB($iWidth, $iHeight, $iBitsPerPel = 32) ;taken from WinAPIEx.au3 by Yashied
    Local $tBIHDR, $hBitmap, $pBits
    Local Const $BI_RGB = 0, $DIB_RGB_COLORS = 0
    Local Const $tagBITMAPINFOHEADER = 'dword biSize;long biWidth;long biHeight;ushort biPlanes;ushort biBitCount;dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant'
    $tBIHDR = DllStructCreate($tagBITMAPINFOHEADER)
    DllStructSetData($tBIHDR, 'biSize', DllStructGetSize($tBIHDR))
    DllStructSetData($tBIHDR, 'biWidth', $iWidth)
    DllStructSetData($tBIHDR, 'biHeight', $iHeight)
    DllStructSetData($tBIHDR, 'biPlanes', 1)
    DllStructSetData($tBIHDR, 'biBitCount', $iBitsPerPel)
    DllStructSetData($tBIHDR, 'biCompression', $BI_RGB)
    $hBitmap = _WinAPI_CreateDIBSection(0, $tBIHDR, $DIB_RGB_COLORS, $pBits)
    If @error Then Return SetError(1, 0, 0)
    Return $hBitmap
    EndFunc ;==>_WinAPI_CreateDIB

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

    Func _WinAPI_CreateDIBSection($hDC, ByRef $tBITMAPINFO, $iUsage, ByRef $pBits, $hSection = 0, $iOffset = 0) ;taken from WinAPIEx.au3 by Yashied
    $pBits = 0
    Local $Ret = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', $hDC, 'ptr', DllStructGetPtr($tBITMAPINFO), 'uint', $iUsage, 'ptr*', 0, 'ptr', $hSection, 'dword', $iOffset)
    If @error Or (Not $Ret[0]) Then Return SetError(1, 0, 0)
    $pBits = $Ret[4]
    Return $Ret[0]
    EndFunc ;==>_WinAPI_CreateDIBSection

    [/autoit]

    Warum hast du dein GDI+ Beispiel in Off-Topic gepostet?

    Gruß,
    UEZ

  • Autoit zu C++ konverter

    • UEZ
    • 1. August 2012 um 00:00

    Ich finde den Ansatz von Ward sehr interessant, C Code Inline zu benutzen, um die von Andy dargestellten Geschwindigkeitsprobleme zu lösen.

    D.h. z.B. ich muss eine Bitmap mit Pixeln füllen, tue dies aber mit Inline C oder von mir auch mit C++. Im Prinzip was Andy / Ward mit dem Inline ASM gebastelt hat.

    Zurück zu moritz1243: was ist der Sinn mit AutoIt C++ Code zu erstellen? (nicht negativ gemeint!)

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 31. Juli 2012 um 13:53

    Du willst aus vorgefertigten Texten (Menu) aussuchen können und diese dann im Bild positionieren?

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <gdiplus.au3>
    #include <misc.au3>

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

    Global $afont[8]
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile(FileOpenDialog("Bild auswählen", @ScriptDir, "Bilder (*.jpg)"))
    If Not $hImage Then Exit _GDIPlus_Shutdown()
    $iW = _GDIPlus_ImageGetWidth($hImage)
    $iH = _GDIPlus_ImageGetHeight($hImage)
    $hCtxt_bg = _GDIPlus_ImageGetGraphicsContext($hImage)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt_bg, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt_bg, "int", 4)

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

    $x = 140
    $y = 110

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

    $Form1 = GUICreate("Form1", $iW, $iH)
    $MenuItem1 = GUICtrlCreateMenu("Texte und Schriften")
    $mnText1 = GUICtrlCreateMenuItem("Hunde", $MenuItem1)
    $mnText2 = GUICtrlCreateMenuItem("Katzen", $MenuItem1)
    GUISetState()

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

    Global $Text[4]

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

    $Text[0] = "Welpen"
    $Text[1] = "Hunde"
    $Text[2] = "Katzen"
    $Text[3] = "Vögel"

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

    ;_ArrayDisplay($Text)

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

    Global $aFont, $hBrush, $hFamily, $hFont, $hFormat, $tLayout, $aInfo
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1)
    ;$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4)
    _GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Global $hDLL = DllOpen("user32.dll")

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Ilse.jpg")
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hCtxt_bg)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_Shutdown()
    DllClose($hDLL)
    GUIDelete()
    Exit

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

    Case $mnText1
    $sText = $Text[1]
    _Schrift()
    Case $mnText2
    $sText = $Text[2]
    _Schrift()
    EndSwitch
    If _IsPressed("25") Then
    $x -= 1
    DllStructSetData($tLayout, "X", $x)
    Update()
    ElseIf _IsPressed("27") Then
    $x += 1
    DllStructSetData($tLayout, "X", $x)
    Update()
    ElseIf _IsPressed("26") Then
    $y -= 1
    DllStructSetData($tLayout, "Y", $y)
    Update()
    ElseIf _IsPressed("28") Then
    $y += 1
    DllStructSetData($tLayout, "Y", $y)
    Update()
    ElseIf _IsPressed("0D") Then
    While _IsPressed("0D")
    WEnd
    _GDIPlus_GraphicsDrawStringEx($hCtxt_bg, $sText, $hFont, $tLayout, $hFormat, $hBrush)
    ConsoleWrite("Text auf das Hintergrundbild kopiert!" & @LF)
    EndIf
    WEnd

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

    Func Update()
    ;MsgBox(0,"",$x&"-"&$y)
    _GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $sText, $hFont, $tLayout, $hFormat, $hBrush)
    ;_GDIPlus_GraphicsDrawStringEx($hCtxt, $Text2, $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Return 1
    EndFunc ;==>Update

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

    Func _Schrift()
    $tLayout = 0
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    $afont = _ChooseFont()
    If @error Then Return
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $afont[7])
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate($afont[2])
    $hFont = _GDIPlus_FontCreate($hFamily, $afont[3], $afont[1])
    $tLayout = _GDIPlus_RectFCreate($x, $y, 0, 0)
    $aInfo = _GDIPlus_GraphicsMeasureString($hCtxt, $sText, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $sText, $hFont, $aInfo[0], $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    EndFunc ;==>_Schrift

    [/autoit]


    So was?

    Gruß,
    UEZ

  • GDI Plus Array

    • UEZ
    • 31. Juli 2012 um 13:16

    Du musst die Schrift auch auf das Hintergrundbild übertragen:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <gdiplus.au3>
    #include <misc.au3>

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

    Global $afont[8]
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile(FileOpenDialog("Bild auswählen", @ScriptDir, "Bilder (*.jpg)"))
    If Not $hImage Then Exit _GDIPlus_Shutdown()
    $iW = _GDIPlus_ImageGetWidth($hImage)
    $iH = _GDIPlus_ImageGetHeight($hImage)
    $hCtxt_bg = _GDIPlus_ImageGetGraphicsContext($hImage)

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

    $x = 140
    $y = 110

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

    $Form1 = GUICreate("Form1", $iW, $iH)
    $MenuItem1 = GUICtrlCreateMenu("Texte und Schriften")
    $mnText1 = GUICtrlCreateMenuItem("Hunde", $MenuItem1)
    $mnText2 = GUICtrlCreateMenuItem("Katzen", $MenuItem1)
    GUISetState()

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

    Global $Text[4]

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

    $Text[0] = "Welpen"
    $Text[1] = "Hunde"
    $Text[2] = "Katzen"
    $Text[3] = "Vögel"

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

    ;_ArrayDisplay($Text)

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Form1)
    ;$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4)
    _GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    ;$aFont = _ChooseFont()
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $afont[7])
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate($afont[2])
    $hFont = _GDIPlus_FontCreate($hFamily, $afont[3], $afont[1])
    $tLayout = _GDIPlus_RectFCreate($x, $y, 1000, 1000)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $Text[1], $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Global $hDLL = DllOpen("user32.dll")

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Ilse.jpg")
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hCtxt_bg)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_Shutdown()
    DllClose($hDLL)
    GUIDelete()
    Exit

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

    Case $mnText1
    _Schrift1()
    Case $mnText2
    _Schrift2()

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

    EndSwitch
    If _IsPressed("25") Then
    $x -= 1
    DllStructSetData($tLayout, "X", $x)
    Update()
    ElseIf _IsPressed("27") Then
    $x += 1
    DllStructSetData($tLayout, "X", $x)
    Update()
    ElseIf _IsPressed("26") Then
    $y -= 1
    DllStructSetData($tLayout, "Y", $y)
    Update()
    ElseIf _IsPressed("28") Then
    $y += 1
    DllStructSetData($tLayout, "Y", $y)
    Update()
    ElseIf _IsPressed("0D") Then
    _GDIPlus_GraphicsDrawStringEx($hCtxt_bg, $Text[1], $hFont, $tLayout, $hFormat, $hBrush)
    EndIf
    WEnd

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

    Func Update()
    ;MsgBox(0,"",$x&"-"&$y)
    _GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $Text[1], $hFont, $tLayout, $hFormat, $hBrush)
    ;_GDIPlus_GraphicsDrawStringEx($hCtxt, $Text2, $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Return 1
    EndFunc ;==>Update

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

    Func _Schrift1()
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    $afont = _ChooseFont()
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $afont[7])
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate($afont[2])
    $hFont = _GDIPlus_FontCreate($hFamily, $afont[3], $afont[1])
    $tLayout = _GDIPlus_RectFCreate($x, $y, 1000, 1000)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $Text[1], $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Global $hDLL = DllOpen("user32.dll")
    EndFunc ;==>_Schrift1

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

    Func _Schrift2()

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    $afont = _ChooseFont()
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $afont[7])
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate($afont[2])
    $hFont = _GDIPlus_FontCreate($hFamily, $afont[3], $afont[1])
    $tLayout = _GDIPlus_RectFCreate($x, $y, 1000, 1000)
    _GDIPlus_GraphicsDrawStringEx($hCtxt, $Text[2], $hFont, $tLayout, $hFormat, $hBrush)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Global $hDLL = DllOpen("user32.dll")
    EndFunc ;==>_Schrift2

    [/autoit]

    Wenn du die Enter Taste drückst, wird der Text auf das Hintergrundbild kopiert.

    Gruß,
    UEZ

  • Daten aus CSV Datei in ein Array Übernehmen

    • UEZ
    • 31. Juli 2012 um 12:38

    autoBert: stimmt, denn die Funktion trennt strikt nach Komma und ein Token "Victoria,Dr" wird auch getrennt. Wenn ich den Delimiter ersetze, damit die Trennung eindeutig ist, funzt die Funktion.

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    $gs_dummydata = _
    '"Nachname"|"Vorname"|"Straße"|"Hausnummer"|"PLZ"|"Ort"|"Anzahl"|"Verbrauch"|"Musterartikel"|"Musterart"' & @CRLF & _
    '"Musterman"|"Fritz"|"Feierstr."|5"|"23333"|""Hamelhausen""|"5"|"3050"|""1"|"3"' & @CRLF & _
    '"Musterfrau"|"Victoria,Dr."|"Abendrotstr.""|"7"|"23455"|""Aschendorf""|"3"|""|""1"|"3"' & @CRLF & _
    '"Müller"|"Heinz,Dr."|"Feldstr.""|"1"|"23455"|""Aschendorf""|""|"7700"|""1"|"3"'

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

    Global $aS = StringSplitW($gs_dummydata, "|")
    _ArrayDisplay($aS)

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

    ; #FUNCTION# ======================================================================================
    ; Name ................: StringSplitW()
    ; Version .............: v0.90 build 2012-05-30 beta
    ; Description .......: Splits a string into columns instead of rows as it is done by SplitString(), like a csv file to a 2d array ;)
    ; Syntax ..............: StringSplitW($string, $delimiter, $max_width)
    ; Parameters ........: $string - string to split
    ; $delimiter - the delimter how to split the string
    ; Return values ....: Success - 2d array
    ; Failure 1 - either $string or $delimter is not set
    ; Failure 2 - array width exceeded
    ; Failure 3 - 2D array memory exceeded -> width + height > 0x5EFA
    ; Author ..............: UEZ
    ; Modified ............:
    ; Remarks ............:
    ; Related ..............: StringSplit()
    ; =================================================================================================
    Func StringSplitW($string, $delimiter)
    If $string = "" Or $delimiter = "" Then Return SetError(1, 0, 0)
    Local $chk, $width, $i, $j, $k, $len, $max = 1, $max_width
    Local $aPos[1], $l = 0
    Local $aSplit = StringSplit($string, @LF)
    $max_width = 0x5EFA - $aSplit[0]
    If $max_width < 1 Then Return SetError(3, 0, 0)
    Local $aVertical[$aSplit[0]][$max_width]
    For $k = 1 To $aSplit[0]
    $len = StringLen($aSplit[$k])
    If $len > 1 Then
    $chk = StringReplace($aSplit[$k], $delimiter, $delimiter)
    $width = @extended
    If $width > $max_width Then Return SetError(2, 0, 0)
    If $width >= $max Then $max = $width + 1
    Switch $width
    Case 0
    $aVertical[$l][0] = $aSplit[$k]
    Case Else
    Dim $aPos[$width * 2 + 2]
    $j = 1
    $aPos[0] = 1
    For $i = 0 To $width - 1
    $aPos[$j] = StringInStr($aSplit[$k], $delimiter, 0, $i + 1) - 1
    $aPos[$j + 1] = $aPos[$j] + 2
    $j += 2
    Next
    $aPos[UBound($aPos) - 1] = StringLen($aSplit[$k])
    $j = 0
    For $i = 0 To UBound($aPos) - 1 Step 2
    $aVertical[$l][$j] = StringMid($aSplit[$k], $aPos[$i], $aPos[$i + 1] - $aPos[$i] + 1)
    $j += 1
    Next
    EndSwitch
    $l += 1
    EndIf
    Next
    ReDim $aVertical[$l][$max]
    Return $aVertical
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Daten aus CSV Datei in ein Array Übernehmen

    • UEZ
    • 31. Juli 2012 um 10:02

    Probiere es mal damit -> [ gelöst ] CSV-Datei in ein Array einlesen

    Gruß,
    UEZ

  • Xorianator...

    • UEZ
    • 31. Juli 2012 um 09:59

    Auch von mir ein Happy Birthday und alles Gute.

    Gruß,
    UEZ

  • GDI+ Spielerei: Rolle aus Rechtecken

    • UEZ
    • 29. Juli 2012 um 11:59

    Läuft sauber, kein Ruckeln zu sehen.

    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™