Gui in dem Bilder angezeit werden

  • Hallo Community,

    ich möchte
    gerne eine GUI erstellen, in dem ein Bild (Hintergrund.jpg) angezeigt
    wird.

    Über Button bzw. Buttons das
    Hintergrundbild geändert werden kann. (Hintergrund1.jpg
    ,
    Hintergrund2.jpg , Hintergrund3.jpg
    , Hintergrund4.jpg...)


    Auf der Rechten Seite sollen Gif Bilder (Durchsichtig)
    zusehen sein.

    Wenn ein Gif Bild angeklickt wird, soll es auf
    das Hintergrund Bild abgelegt werden. (
    Breite und Höhe von
    Gif Bild muß festgesetzt sein, damit es immer gleich groß ist
    )

    Die SuFu hilft mir auch nicht so richtig
    weiter, bitte um Hilfe ob das zu realisieren ist oder
    nicht.

    Danke

    Mit freundlichen Grüßen

    HGF

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename

    3 Mal editiert, zuletzt von HGF (21. November 2010 um 20:18)

  • Spoiler anzeigen

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename

    Einmal editiert, zuletzt von HGF (21. November 2010 um 15:57)

  • Hier ein sehr einfaches und erweiterungsbedürftiges Skript:

    Spoiler anzeigen
    [autoit]


    #include <File.au3>
    #include <GuiConstants.au3>
    #include <GDIPlus.au3>

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

    Local $hImage, $msg
    Local $pBilder = FileSelectFolder("Bitte Ordner mit JPG Bildern auswählen", "")
    If @error Then Exit
    Local $fBilder = _FileListToArray($pBilder, "*.jpg", 1)
    If Not IsArray($fBilder) Then Exit

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

    Local $hGUI = GUICreate("GDI+ Bilder Betrachter", 900, 600)
    Local $hButton1 = GUICtrlCreateButton("Nächstes Bild", 810, 50)
    Local $hButton2 = GUICtrlCreateButton("Voriges Bild", 810, 100)
    Local $hButton3 = GUICtrlCreateButton("Ende", 810, 150)
    GUISetState(@SW_SHOW)

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

    Local $W = 800
    Local $H = 600

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

    _GDIPlus_Startup()
    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($W, $H, $hGraphic)
    Local $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    Local $z = 1

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

    Lade_Bild($z)

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

    While Sleep(50)
    $msg = GUIGetMsg()
    Select
    Case $msg = $hButton1
    $z += 1
    If $z > $fBilder[0] Then $z = 1
    Lade_Bild($z)
    Case $msg = $hButton2
    $z -= 1
    If $z < 1 Then $z = $fBilder[1]
    Lade_Bild($z)
    Case $msg = $hButton3 Or $msg = $GUI_EVENT_CLOSE
    _Exit()
    EndSelect
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $W, $H)
    WEnd

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

    Func Lade_Bild($z)
    $hImage = _GDIPlus_ImageLoadFromFile($pBilder & "\" & $fBilder[$z])
    $iX = _GDIPlus_ImageGetWidth($hImage)
    $iY = _GDIPlus_ImageGetHeight($hImage)

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

    $r = Verhaeltnis($iX, $iY)
    $e = @extended

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

    _GDIPlus_GraphicsClear($hBackbuffer)
    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hImage, 0, 0, $r, $e)
    EndFunc

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

    Func Verhaeltnis($breite, $hoehe)
    Local $faktor
    If $breite > $hoehe Then
    $faktor = $W / $breite
    Else
    $faktor = $H / $hoehe
    EndIf
    Return SetError(0, $hoehe * $faktor, $breite * $faktor)
    EndFunc

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

    Func _Exit()
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    EndFunc

    [/autoit]

    Viel Spaß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

    2 Mal editiert, zuletzt von UEZ (15. Oktober 2010 um 12:07)

  • Danke UEZ, aber es Klappt nicht!

    Ich hatte es mir anders vorgestellt...

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename

  • Was klappt nicht?

    Ferner wollte ich dir nur eine Richtung zeigen und nicht für dich alles coden, da du selbst ja was lernen sollst! ;)

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Erst einmal einen einen lieben Dank und Gruß an UEZ!
    Ohne seine Hilfe wäre ich wahrscheinlich noch gar nicht soweit!

    So nun benötige ich noch eine kleine Hilfe!

    Thema Speichern:

    Ich möchte die Bilder genau so speichern wie Sie in dem GUI angezeigt werden!


    Spoiler anzeigen
    [autoit]

    ; #DANKE# ====================================================================================================================
    ;
    ; Ersteinmal Vielen Dank an ....: UEZ
    ; Author (Hauptprogramm)........: UEZ
    ; Author (Function).............: UEZ
    ; Weiterentwickelt von .........: GHF
    ; Natürlich mit Hilfe von.......: UEZ und den AutoIt Forum Mitgliedern
    ;
    ; #DANKE# ====================================================================================================================
    #include <Array.au3>
    #include <GDIPlus.au3>
    #include <GuiComboBoxEx.au3>
    #include <GuiImageList.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GuiConstantsEx.au3>
    #include <File.au3>
    #include <WindowsConstants.au3>
    #Include <WinAPIEx.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>
    $hGUI1 = GUICreate("Daten werden geladen ...", 400, 80)
    GUISetBkColor(0xFFFFFF)
    GuiCtrlCreateProgress(100, 20, 150, 20)
    GuiCtrlSetData(-1, 5)
    GuiCtrlSetData(-1, 10)
    GuiCtrlSetData(-1, 15)
    GuiCtrlSetData(-1, 20)
    GuiCtrlSetData(-1, 40)
    GuiCtrlSetData(-1, 60)
    GuiCtrlSetData(-1, 75)
    GuiCtrlSetData(-1, 80)
    GuiCtrlSetData(-1, 85)
    GuiCtrlSetData(-1, 96)
    GuiCtrlCreateLabel("Status:", 10, 22, 100)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("26.10.2010"&@CRLF&"Version: 0.0.1", 240, 9, 150, -1, $ES_RIGHT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GuiCtrlCreateLabel("(Daten werden geladen bitte haben Sie etwas geduld)", 10, 55, 400, 30)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    _GDIPlus_Startup()
    $image_path = (@ScriptDir & '\include01\')
    $image_pathover = (@ScriptDir & '\include02\')
    Global $hPic = -99
    Global $hPicover = -99
    $count = _FileListToArray($image_path, "*.gif", 1)
    $countover = _FileListToArray($image_pathover, "*.gif", 1)
    If Not IsArray($count) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_path, 10)
    If Not IsArray($countover) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_pathover, 10)
    $hGUI = GUICreate("Bild1 und Bild2 - Vorschau", 798, 655)
    GUISetBkColor(0xFFFFFF)
    $hComboover = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 15, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$countover[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImageover = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $countover[0]
    _GUIImageList_AddBitmapEx($hImageover, $image_pathover & "\" & $countover[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hComboover, $hImageover)
    For $i = 0 To $countover[0] - 1
    _GUICtrlComboBoxEx_AddString($hComboover, $image_pathover & "\" & $countover[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hComboover, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hComboover, 0)
    $bottonover = GUICtrlCreateButton("Bild1 anzeigen", 715, 14, 60, 56, $BS_MULTILINE)
    $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 76, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$count[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImage = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $count[0]
    _GUIImageList_AddBitmapEx($hImage, $image_path & "\" & $count[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)
    For $i = 0 To $count[0] - 1
    _GUICtrlComboBoxEx_AddString($hCombo, $image_path & "\" & $count[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hCombo, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hCombo, 0)
    $botton = GUICtrlCreateButton("Bild2 anzeigen", 715, 75, 60, 56, $BS_MULTILINE)
    $Textanzeigen1 = GUICtrlCreateButton("Text 1", 640, 350, 150, 25, $BS_CENTER)
    $Textanzeigen2 = GUICtrlCreateButton("Text 2", 640, 380, 150, 25, $BS_CENTER)
    $SaveButton = GUICtrlCreateButton("SAVE", 640, 410, 150, 25, $BS_CENTER)
    $Software1 = GUICtrlCreateButton(" Soft1 Starten", 640, 440, 150, 25, $BS_CENTER)
    $Info = GUICtrlCreateButton(" Info zur Software", 640, 470, 150, 25, $BS_CENTER)
    $Button1 = GUICtrlCreateButton(" ", 640, 500, 150, 25, $BS_CENTER)
    $Button2 = GUICtrlCreateButton(" ", 640, 530, 150, 25, $BS_CENTER)
    $Button3 = GUICtrlCreateButton(" ", 640, 560, 150, 25, $BS_CENTER)
    GUICtrlCreateLabel("Version: 0.0.1", 640, 630, 100, -1, $ES_LEFT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GUISetState(@SW_HIDE, $hGUI1)
    GUISetState(@SW_SHOW, $hGUI)
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $gui_event_close
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    Case $msg = $bottonover
    $iItemover = _GUICtrlComboBoxEx_GetCurSel($hComboover)+1
    $aItemover = _GUICtrlComboBoxEx_GetItem($hComboover,$iItemover)
    $hImageover = _GDIPlus_BitmapCreateFromFile ($aItemover[0])
    $iX = _GDIPlus_ImageGetWidth($hImageover)
    $iY = _GDIPlus_ImageGetHeight($hImageover)
    _GDIPlus_BitmapDispose($hImageover)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 300
    $iY = 300
    Else
    $iY = 300
    $iX = 300
    EndIf
    if $hPicover <> -99 then GUICtrlDelete($hPicover)
    $hPicover = GUICtrlCreatePic($aItemover[0], 175, 110, $iX , $iY)
    Case $msg = $botton
    $iItem = _GUICtrlComboBoxEx_GetCurSel($hCombo)+1
    $aItem = _GUICtrlComboBoxEx_GetItem($hCombo,$iItem)
    $hImage = _GDIPlus_BitmapCreateFromFile ($aItem[0])
    $iX = _GDIPlus_ImageGetWidth($hImage)
    $iY = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_BitmapDispose($hImage)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 650
    $iY = 600
    Else
    $iY = 650
    $iX = 600
    EndIf

    if $hPic <> -99 then GUICtrlDelete($hPic)
    $hPic = GUICtrlCreatePic($aItem[0], 0, 20, $iX, $iY)
    Case $msg = $Info
    If $Info Then ContinueLoop MsgBox(64, "Info: Bitte Lesen", "Bedienungsanleitung:"&@CRLF&""&@CRLF&"1. Motiv auswählen"&@CRLF&"Motiv anzeigen Button anklicken"&@CRLF&" "&@CRLF&"2. Produkt auswählen"&@CRLF&"Produkt anzeigen Button anklicken"&@CRLF&" "&@CRLF&" "&@CRLF&" ")
    Exit
    Case $msg = $Software1
    ShellExecute("Soft1.exe")
    Case $msg = $SaveButton

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

    $himg2 = _GDIPlus_ImageLoadFromFile($aItem[0])
    $himg3 = _GDIPlus_ImageLoadFromFile($aItemover[0])
    $Save = FileSaveDialog("Speichere Bild", @ScriptDir, "JPG (*.JPG)")
    $ToBild2 = _GDIPlus_ImageGetGraphicsContext ($himg2)
    $iX = _GDIPlus_ImageGetWidth ($himg2)
    $iY = _GDIPlus_ImageGetHeight ($himg2)
    $iX2 = _GDIPlus_ImageGetWidth ($himg3)
    $iY2 = _GDIPlus_ImageGetHeight ($himg3)
    $a=_GDIPlus_GraphicsDrawImage ($ToBild2,$himg3, 400, 210)
    _GDIPlus_ImageSaveToFile($himg2, $Save & "")
    _GDIPlus_ImageDispose($himg2)
    _GDIPlus_ImageDispose($himg3)
    _GDIPlus_ImageDispose($himg3)
    EndSelect
    WEnd
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GUIImageList_AddBitmapEx
    ; Description ...: Creates a bitmap from an image file (JPG, PNG, BMP, GIF, etc.) and adds it to the _GUIImageList control
    ; Syntax.........: _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth, $iHeight)
    ; Parameters ....: $hWnd - file name where the icon should be extracted from (*.dll, *.ico, *.exe)
    ; $sFile - path to the bitmap that contains the image
    ; $iWidth - width of the _GUIImageList
    ; $iHeight - height of the _GUIImageList
    ; Return values .: Success - Returns 1
    ; Failure - @error
    ; Author ........: UEZ
    ; Version .......: 0.5 Build 2010-06-22
    ; Remarks .......: <GDIPlus.au3> must be included and _GDIPlus_Startup() must be started to use GDI+ functions.
    ; Don't forget the _GDIPlus_Shutdown() when closing
    ; ===============================================================================================================================
    Func _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth = 48, $iHeight = 48)
    If $hWnd = 0 Or $sFile = "" Or Not IsDeclared("ghGDIPDll") Then Return SetError(1, 0, 0)
    Local $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0
    Local $bitmap_from_file = _GDIPlus_BitmapCreateFromFile($sFile)
    If @error Then Return SetError(@error, @extended, 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)
    Local $hClone = $aResult[6]
    $hGraphics = _GDIPlus_ImageGetGraphicsContext($hClone)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $bitmap_from_file, 0, 0, $iWidth, $iHeight)
    $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hClone)
    _GUIImageList_Add($hWnd, $hBmp)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($bitmap_from_file)
    _GDIPlus_BitmapDispose($hClone)
    _WinAPI_DeleteObject($hBmp)
    Return SetError(0, 0, 1)
    EndFunc

    [/autoit]

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename

  • Hallo Name22!


    Zitat

    Ich möchte die Bilder genau so speichern wie Sie in dem GUI angezeigt werden!

    Wie abspeichern? Als Bild? Das ist schwer vorstellbar ohne funktionsfähiges Script. :S

    Die beiden Bilder werden zur Zeit abgespeichert!
    Das Script ist funktionsfähig! :cursing:
    Es klappt, jedoch nicht so wie es im GUI angezeigt wird!

    Soll zustand:
    Also Bild 1 soll als Hintergrund / Untergrund und Bild 2 da drauf auf festgesetzten Bereich gespeichert werden.

    Ist zustand:
    Bild 1 wird als Hintergrund / Untergrund und Bild 2 da drauf gespeichert.
    Aber beide Bilder werden in tatsächlicher Größe gespeichert ich kann zur Zeit die Größe nicht beeinflussen (Höhe und Breite) !!!

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename

  • Zitat

    Das Script ist funktionsfähig! :cursing:


    Nicht auf meinem PC, ich habe weder die WinApiEx.au3 noch die verwendeten Bilder. Das habe ich mit schlecht vorstellbar gemeint, ein Script in Action zu sehen bringt halt meistens mehr wenn du es nicht geschrieben hast. ;)
    Das Bild wird doch mit $a=_GDIPlus_GraphicsDrawImage ($ToBild2,$himg3, 400, 210) auf das andere gezeichnet oder? Dann ersetzt du halt _GDIPlus_GraphicsDrawImage durch _GDIPlus_GraphicsDrawImageRect. Dann kannst du nicht nur X und Y Position festlegen, sondern auch Breite und Höhe.

  • Ich weiß nicht, ob du das hier meinst:

    Spoiler anzeigen
    [autoit]


    ; #DANKE# ====================================================================================================================
    ;
    ; Ersteinmal Vielen Dank an ....: UEZ
    ; Author (Hauptprogramm)........: UEZ
    ; Author (Function).............: UEZ
    ; Weiterentwickelt von .........: GHF
    ; Natürlich mit Hilfe von.......: UEZ und den AutoIt Forum Mitgliedern
    ;
    ; #DANKE# ====================================================================================================================
    #include <Array.au3>
    #include <GDIPlus.au3>
    #include <GuiComboBoxEx.au3>
    #include <GuiImageList.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GuiConstantsEx.au3>
    #include <File.au3>
    #include <WindowsConstants.au3>
    #Include <WinAPIEx.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>
    $hGUI1 = GUICreate("Daten werden geladen ...", 400, 80)
    GUISetBkColor(0xFFFFFF)
    GuiCtrlCreateProgress(100, 20, 150, 20)
    GuiCtrlSetData(-1, 5)
    GuiCtrlSetData(-1, 10)
    GuiCtrlSetData(-1, 15)
    GuiCtrlSetData(-1, 20)
    GuiCtrlSetData(-1, 40)
    GuiCtrlSetData(-1, 60)
    GuiCtrlSetData(-1, 75)
    GuiCtrlSetData(-1, 80)
    GuiCtrlSetData(-1, 85)
    GuiCtrlSetData(-1, 96)
    GuiCtrlCreateLabel("Status:", 10, 22, 100)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("26.10.2010"&@CRLF&"Version: 0.0.1", 240, 9, 150, -1, $ES_RIGHT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GuiCtrlCreateLabel("(Daten werden geladen bitte haben Sie etwas geduld)", 10, 55, 400, 30)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    _GDIPlus_Startup()
    $image_path = (@ScriptDir & '\include01\')
    $image_pathover = (@ScriptDir & '\include02\')
    Global $hPic = -99
    Global $hPicover = -99
    $count = _FileListToArray($image_path, "*.gif", 1)
    $countover = _FileListToArray($image_pathover, "*.gif", 1)
    If Not IsArray($count) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_path, 10)
    If Not IsArray($countover) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_pathover, 10)
    $hGUI = GUICreate("Bild1 und Bild2 - Vorschau", 798, 655)
    GUISetBkColor(0xFFFFFF)
    $hComboover = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 15, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$countover[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImageover = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $countover[0]
    _GUIImageList_AddBitmapEx($hImageover, $image_pathover & "\" & $countover[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hComboover, $hImageover)
    For $i = 0 To $countover[0] - 1
    _GUICtrlComboBoxEx_AddString($hComboover, $image_pathover & "\" & $countover[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hComboover, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hComboover, 0)
    $bottonover = GUICtrlCreateButton("Bild1 anzeigen", 715, 14, 60, 56, $BS_MULTILINE)
    $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 76, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$count[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImage = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $count[0]
    _GUIImageList_AddBitmapEx($hImage, $image_path & "\" & $count[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)
    For $i = 0 To $count[0] - 1
    _GUICtrlComboBoxEx_AddString($hCombo, $image_path & "\" & $count[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hCombo, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hCombo, 0)
    $botton = GUICtrlCreateButton("Bild2 anzeigen", 715, 75, 60, 56, $BS_MULTILINE)
    $Textanzeigen1 = GUICtrlCreateButton("Text 1", 640, 350, 150, 25, $BS_CENTER)
    $Textanzeigen2 = GUICtrlCreateButton("Text 2", 640, 380, 150, 25, $BS_CENTER)
    $SaveButton = GUICtrlCreateButton("SAVE", 640, 410, 150, 25, $BS_CENTER)
    $Software1 = GUICtrlCreateButton(" Soft1 Starten", 640, 440, 150, 25, $BS_CENTER)
    $Info = GUICtrlCreateButton(" Info zur Software", 640, 470, 150, 25, $BS_CENTER)
    $Button1 = GUICtrlCreateButton(" ", 640, 500, 150, 25, $BS_CENTER)
    $Button2 = GUICtrlCreateButton(" ", 640, 530, 150, 25, $BS_CENTER)
    $Button3 = GUICtrlCreateButton(" ", 640, 560, 150, 25, $BS_CENTER)
    GUICtrlCreateLabel("Version: 0.0.1", 640, 630, 100, -1, $ES_LEFT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GUISetState(@SW_HIDE, $hGUI1)
    GUISetState(@SW_SHOW, $hGUI)
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $gui_event_close
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    Case $msg = $bottonover
    $iItemover = _GUICtrlComboBoxEx_GetCurSel($hComboover)+1
    $aItemover = _GUICtrlComboBoxEx_GetItem($hComboover,$iItemover)
    $hImageover = _GDIPlus_BitmapCreateFromFile ($aItemover[0])
    $iX = _GDIPlus_ImageGetWidth($hImageover)
    $iY = _GDIPlus_ImageGetHeight($hImageover)
    _GDIPlus_BitmapDispose($hImageover)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 300
    $iY = 300
    Else
    $iY = 300
    $iX = 300
    EndIf
    if $hPicover <> -99 then GUICtrlDelete($hPicover)
    $hPicover = GUICtrlCreatePic($aItemover[0], 175, 110, $iX , $iY)
    Case $msg = $botton
    $iItem = _GUICtrlComboBoxEx_GetCurSel($hCombo)+1
    $aItem = _GUICtrlComboBoxEx_GetItem($hCombo,$iItem)
    $hImage = _GDIPlus_BitmapCreateFromFile ($aItem[0])
    $iX = _GDIPlus_ImageGetWidth($hImage)
    $iY = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_BitmapDispose($hImage)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 650
    $iY = 600
    Else
    $iY = 650
    $iX = 600
    EndIf

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

    if $hPic <> -99 then GUICtrlDelete($hPic)
    $hPic = GUICtrlCreatePic($aItem[0], 0, 20, $iX, $iY)
    Case $msg = $Info
    If $Info Then ContinueLoop MsgBox(64, "Info: Bitte Lesen", "Bedienungsanleitung:"&@CRLF&""&@CRLF&"1. Motiv auswählen"&@CRLF&"Motiv anzeigen Button anklicken"&@CRLF&" "&@CRLF&"2. Produkt auswählen"&@CRLF&"Produkt anzeigen Button anklicken"&@CRLF&" "&@CRLF&" "&@CRLF&" ")
    Exit
    Case $msg = $Software1
    ShellExecute("Soft1.exe")
    Case $msg = $SaveButton

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

    ;~ $himg2 = _GDIPlus_ImageLoadFromFile($aItem[0])
    ;~ $himg3 = _GDIPlus_ImageLoadFromFile($aItemover[0])
    $Save = FileSaveDialog("Speichere Bild", @ScriptDir, "JPG (*.JPG)")
    ;~ $ToBild2 = _GDIPlus_ImageGetGraphicsContext ($himg2)
    ;~ $iX = _GDIPlus_ImageGetWidth ($himg2)
    ;~ $iY = _GDIPlus_ImageGetHeight ($himg2)
    ;~ $iX2 = _GDIPlus_ImageGetWidth ($himg3)
    ;~ $iY2 = _GDIPlus_ImageGetHeight ($himg3)
    ;~ $a=_GDIPlus_GraphicsDrawImage ($ToBild2,$himg3, 400, 210)
    ;~ _GDIPlus_ImageSaveToFile($himg2, $Save & "")
    _GDIPlus_Save_to_Image($Save, $hGUI, 640, 655)
    If Not @error Then MsgBox(0, "Information", "Bild wurde gespeichert!")
    ;~ _GDIPlus_ImageDispose($himg2)
    ;~ _GDIPlus_ImageDispose($himg3)
    ;~ _GDIPlus_ImageDispose($himg3)
    EndSelect
    WEnd
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GUIImageList_AddBitmapEx
    ; Description ...: Creates a bitmap from an image file (JPG, PNG, BMP, GIF, ICO, etc.) and adds it to the _GUIImageList control
    ; Syntax.........: _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth, $iHeight)
    ; Parameters ....: $hWnd - file name where the icon should be extracted from (*.dll, *.ico, *.exe)
    ; $sFile - path to the bitmap that contains the image
    ; $iWidth - width of the _GUIImageList
    ; $iHeight - height of the _GUIImageList
    ; Return values .: Success - Returns 1
    ; Failure - @error
    ; Author ........: UEZ
    ; Version .......: 0.75 Build 2010-06-23 beta
    ; Remarks .......: <GDIPlus.au3> must be included and _GDIPlus_Startup() must be started to use GDI+ functions.
    ; Don't forget the _GDIPlus_Shutdown() when closing!
    ; ===============================================================================================================================
    Func _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth = 48, $iHeight = 48, $iIndex = 0)
    If Not IsHWnd($hWnd) = 0 Or $sFile = "" Or Not FileExists($sFile) Or IsDeclared("ghGDIPDll") <> 1 Then Return SetError(1, 0, 0)

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

    Local $bitmap_from_file = _GDIPlus_BitmapCreateFromFile($sFile)
    If @error Then Return SetError(@error, @extended, 0)
    Local $ext = StringRight($sFile, 3)
    If $ext = "ico" Then
    Local $aRet = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $sFile, "word*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Local $hIcon = $aRet[0]
    Local $hDC = _WinAPI_GetDC(0) ;thanks to Yashied
    Local $hBackDC = _WinAPI_CreateCompatibleDC($hDC)
    Local $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU), $iWidth, $iHeight)
    Local $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap)
    _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, 0, 0, 0, 0, 3)
    _WinAPI_SelectObject($hBackDC, $hBackSv)
    _WinAPI_ReleaseDC(0, $hDC)
    _WinAPI_DeleteDC($hBackDC)
    _GUIImageList_Add($hWnd, $hBitmap)
    _WinAPI_DeleteObject($hBitmap)
    Else
    Local $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)

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

    Local $hClone = $aResult[6]
    Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hClone)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $bitmap_from_file, 0, 0, $iWidth, $iHeight)

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

    Local $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hClone)
    _GUIImageList_Add($hWnd, $hBmp)

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

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hClone)
    _WinAPI_DeleteObject($hBmp)
    EndIf
    _GDIPlus_BitmapDispose($bitmap_from_file)
    Return SetError(0, 0, 1)
    EndFunc

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

    ; #FUNCTION# =============================================================================
    ; Name...........: _GDIPlus_Save_to_Image
    ; Description ...: INTERNAL FUNCTION - save drawn image to file
    ; Syntax.........: _GraphGDIPlus_Reference_Pixel($file, $hWnd)
    ; Parameters ....: $file - filename
    ; $hWnd - handle to GUI
    ; Autor .........: ptrex, ProgAndy, UEZ
    ; =========================================================================================
    Func _GDIPlus_Save_to_Image($file, $hWnd, $w, $h, $CLSID = "JPG")
    Local $hDC, $memBmp, $memDC, $hImage, $size, $sCLSID, $err
    If $file <> "" Or $hWnd <> "" Then
    If $w < 1 And $h < 1 Then
    $size = WinGetClientSize($hWnd)
    $w = $size[0]
    $h = $size[1]
    EndIf
    $hDC = _WinAPI_GetDC($hWnd)
    $memDC = _WinAPI_CreateCompatibleDC($hDC)
    $memBmp = _WinAPI_CreateCompatibleBitmap($hDC, $w, $h)
    _WinAPI_SelectObject ($memDC, $memBmp)
    _WinAPI_BitBlt($memDC, 0, 0, $w, $h, $hDC, 0, 0, 0x00CC0020) ; 0x00CC0020 = $SRCCOPY
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($memBmp)
    $sCLSID = _GDIPlus_EncodersGetCLSID ($CLSID)
    ;~ _GDIPlus_ImageSaveToFile($hImage, $file)
    If Not _GDIPlus_ImageSaveToFileEx ($hImage, $file & "." & StringLower($CLSID), $sCLSID) Then $err = 1
    _GDIPlus_ImageDispose ($hImage)
    _WinAPI_ReleaseDC($hWnd, $hDC)
    _WinAPI_DeleteDC($memDC)
    _WinAPI_DeleteObject ($memBmp)
    If $err Then Return SetError(2, 0, 0)
    Return SetError(0, 0, 0)
    Else
    Return SetError(1, 0, 0)
    EndIf
    EndFunc

    [/autoit]

    Da du mit GUICtrlCreatePic() arbeitest, kann man das BIld nicht einfach abspeichern, zumindest kenne ich keine Möglichkeit. Ansonsten ist GDI+ eine Möglichkeit.

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Dank UEZ !

    Das war genau das was ich gesucht habe!

    Ich kann beinen Beitrag wieder schließen.

    Mit freundlichen Grüßen
    HGF

    Mit freundlichen Grüßen
    HGF

    Das aber nur für die Neunmalklugen unter uns:
    Was du heute säst, wirst du später ernten !

    Spoiler anzeigen

    Meine fertigen Skripte: Copy and Rename