I have made some changes. Creating a picture control in a function without destroying the previous picture control is just add another one on top of the previous one. So put control creation in global code and update with GUICtrlSetImage. Replace some functions with Gui... equivalents so it remains handling by internal control ids. I left the picture and label control below the GuiSetState though you can move up into the main gui code if you would like to. Differcult for me to understand the language used so I cannot be sure of doing a good fix.
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("^x", "izlaz1")
#region --- CodeWizard generated code Start ---
;SpashImage features: Title=No, Width=900, Height=400, Always On Top
SplashImageOn("", "twisterfun.jpg", "900", "400", "-1", "-1", 1)
Sleep(1000)
SplashOff()
#endregion --- CodeWizard generated code Start ---
#region ### START Koda GUI section ### Form=C:\Documents and Settings\SlavonskiBrod01\My Documents\My Pictures\Form1.kxf
$Form1_1 = GUICreate("Twisterichne kartice", 624, 450, 192, 114, $WS_BORDER)
$MenuItem1 = GUICtrlCreateMenu("&Izbornik")
$MenuItem4 = GUICtrlCreateMenuItem("&Nova kartica", $MenuItem1)
GUICtrlSetOnEvent($MenuItem4, "svenovo1")
$MenuItem9 = GUICtrlCreateMenuItem("&Izdane kartice", $MenuItem1)
GUICtrlSetOnEvent($MenuItem9, "izdane1")
$MenuItem7 = GUICtrlCreateMenu("&O programu")
$MenuItem3 = GUICtrlCreateMenuItem("---------------", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("I&zlaz (Ctrl+x)", $MenuItem1)
GUICtrlSetOnEvent($MenuItem5, "izlaz1")
$imeprezime = GUICtrlCreateInput("", 100, 40, 120, 21, BitOR($ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Ime i prezime:", 20, 43, 80, 15)
$adresa = GUICtrlCreateInput("", 100, 66, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE))
GUICtrlCreateLabel("Adresa:", 20, 69, 80, 15)
$posta = GUICtrlCreateInput("", 100, 92, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER, $ES_OEMCONVERT))
GUICtrlSetLimit(-1, 5, 5)
GUICtrlCreateLabel("Broj pošte:", 20, 95, 80, 15)
$grad = GUICtrlCreateInput("", 100, 118, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Grad:", 20, 121, 80, 15)
$datum = GUICtrlCreateDate(_NowDate(), 20, 280, 200, 20, $DTS_SHORTDATEFORMAT)
$datumx = _NowDate()
$datumizd = GUICtrlCreateLabel("Datum izdavanja kartice", 20, 260, 118, 15)
$vrijedido = GUICtrlCreateLabel("Vrijedi do:", 20, 320, 50, 17)
;~ $datumizdtxt2 = ControlGetText("Twisterichne kartice", "", "[ID:12]")
$vrsta = GUICtrlCreateCombo("", 20, 170, 200, 25)
;~ $vrsta = GUICtrlCreateList("", 312, 272, 113, 110)
GUICtrlSetData(-1, "Mjesecna|Polugodisnja|Godisnja", "")
GUICtrlSetOnEvent($vrsta, "kartica1")
$vrstakar = GUICtrlCreateLabel("Vrsta kartice", 20, 150, 200, 15)
$brojkartlabel = GUICtrlCreateLabel("Broj kartice", 20, 200, 200, 15)
$brojkart = GUICtrlCreateInput("", 20, 220, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
$djelatna = GUICtrlCreateLabel("Djelatnik:", 20, 17, 60, 15)
$djelatnici = GUICtrlCreateCombo("", 100, 13, 119, 25)
GUICtrlSetData(-1, "Anita Tihi|Nikolina Matanovic", "Anita Tihi")
$Spremi = GUICtrlCreateButton("Spremi", 20, 368, 75, 25)
GUICtrlSetOnEvent($Spremi, "spremi1")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
; *** create these here and not over and over in a function
$pic = GUICtrlCreatePic("", 256, 0, 364, 228)
$vrijedido2 = GUICtrlCreateLabel('', 80, 320, 100, 17)
While 1
Sleep(10) ; *** it is oneventmode so GUIGetMsg will not work
;~ $msg = GUIGetMsg()
;~ Switch $msg
;~ Case $GUI_EVENT_CLOSE
;~ Exit
;~ EndSwitch
WEnd
Func svenovo1() ;put empty values into fields
GUICtrlSetData($imeprezime, '')
GUICtrlSetData($adresa, '')
GUICtrlSetData($posta, '')
GUICtrlSetData($grad, '')
GUICtrlSetData($vrsta, '')
GUICtrlSetData($brojkart, '')
GUICtrlSetImage($pic, "")
EndFunc ;==>svenovo1
Func kartica1()
Switch GUICtrlRead($vrsta)
Case "Mjesecna"
GUICtrlSetImage($pic, "mjesecna.jpg")
$dodandatum = _DateAdd('M', 1, _NowCalcDate())
$konvdatum = StringSplit($dodandatum, "/")
$novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
Case "Polugodisnja"
GUICtrlSetImage($pic, "polugodisnja.jpg")
$dodandatum = _DateAdd('M', 6, _NowCalcDate())
$konvdatum = StringSplit($dodandatum, "/")
$novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
Case "Godisnja"
GUICtrlSetImage($pic, "godisnja.jpg")
$dodandatum = _DateAdd('M', 12, _NowCalcDate())
$konvdatum = StringSplit($dodandatum, "/")
$novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
EndSwitch
GUICtrlSetData($vrijedido2, $novidatum)
EndFunc ;==>kartica1
Func spremi1()
$imeprezimetxt = GUICtrlRead($imeprezime)
$adresatxt = GUICtrlRead($adresa)
$postatxt = GUICtrlRead($posta)
$gradtxt = GUICtrlRead($grad)
$brojkarttxt = GUICtrlRead($brojkart)
$datumizdtxt = GUICtrlRead($datum); *** $datum instead of $datumizd ?
$djelatnicitxt = GUICtrlRead($djelatnici)
$vrijedidotxt = GUICtrlRead($vrijedido)
FileWrite(@ScriptDir & "\izdane kartice\" & $brojkarttxt & "_" & $imeprezimetxt & ".txt", @CRLF & "PREZIME I IME: " & $imeprezimetxt & @CRLF & "ADRESA: " & $adresatxt & @CRLF & "MJESTO: " & $postatxt & " " & $gradtxt & @CRLF & "BROJ KARTICE: " & $brojkarttxt & @CRLF & "KARTICA IZDANA: " & $datumizdtxt & @CRLF & "VRIJEDI DO: " & $vrijedidotxt & @CRLF & @CRLF & "DJELATNICA: " & $djelatnicitxt)
MsgBox(4096, "Podatci", "Podatci spremljeni u txt file pod imenom:" & @CRLF & $brojkarttxt & "_" & $imeprezimetxt & ".txt")
EndFunc ;==>spremi1
Func izdane1()
;~ MsgBox(4,"Pregled izdanih kartica","#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Question
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(36,"Pregled izdanih kartica","Da li zelite otvoriti direktorij u kojem se nalaze izdane kartice?")
Select
Case $iMsgBoxAnswer = 6 ;Yes
Run("Explorer.exe " & @ScriptDir & "\izdane kartice")
Case $iMsgBoxAnswer = 7 ;No
Sleep(100)
EndSelect
#EndRegion --- CodeWizard generated code End ---
EndFunc ;==>izdane1
Func izlaz1()
Exit
EndFunc ;==>izlaz1