Probiere es mal damit (nicht getestet):
Spoiler anzeigen
_GDIPlus_Startup()
;Das ganze ist ein Geburtstagskalender, der mir an dem heutigen Tag die Info und ein Bild, von
;dem jenigen anzeigt, der Geburtstag hat. Über ein Datumsfeld kann man gezielt zu einem bestimmten
;Datum springen. Hier ein Teil des Codes...
;GUICtrlCreatePng springt in die Funktion GUICtrlCreatePng.. übergibt Filepath und "IniFileLine7", das ist ein Leeres Jpg
;um vorhergehende Bilder zu löschen .
func start()
While 1
$msg = GUIGetMsg()
Select
case $msg = $cal
;~ Hier wird das Label zurückgesetzt
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,80,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,80,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,80,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,200,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,200,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,200,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,30,320,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,320,320,98)
GUICtrlCreatePng(0,$filepath_pic&$IniFileLine7,610,320,98)
GUICtrlSetData ($Label, "")
GUICtrlSetData ($Label1, "")
GUICtrlSetData ($Label2, "")
GUICtrlSetData ($Label3, "")
GUICtrlSetData ($Label4, "")
GUICtrlSetData ($Label5, "")
GUICtrlSetData ($Label6, "")
GUICtrlSetData ($Label7, "")
GUICtrlSetData ($Label8, "")
GUICtrlSetData ($Label9, "")
connect()
case $msg = $GUI_EVENT_CLOSE
Exit
case $msg = $beenden
Exit
;~ Bilderpfad für vergrößerte Bilder
case $msg = $Pict1
$bigpic_var= $Picture1
GUICtrlCreatePng1($Pict1,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict2
$bigpic_var= $Picture2
GUICtrlCreatePng1($Pict2,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict3
$bigpic_var= $Picture3
GUICtrlCreatePng1($Pict3,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict4
$bigpic_var= $Picture4
GUICtrlCreatePng1($Pict4,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict5
$bigpic_var= $Picture5
GUICtrlCreatePng1($Pict5,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict6
$bigpic_var= $Picture6
GUICtrlCreatePng1($Pict6,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict7
$bigpic_var= $Picture7
GUICtrlCreatePng1($Pict7,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict8
$bigpic_var= $Picture8
GUICtrlCreatePng1($Pict8,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $Pict9
$bigpic_var= $Picture9
GUICtrlCreatePng1($Pict9,$filepath_pic&$bigpic_var,30,80,$IniFileLine4)
case $msg = $help
$x = $x + 1
Help()
case $msg = $dropdown_name
NameSelect()
case $msg = $mzi
SplashTextOn ("Kontakt", "M" & @LF & "Beter"&@LF& "urg.cat"&@LF&@LF&"Dieses Fenster schließt sich automatisch!", 250,100, @DesktopWidth/2-125, @DesktopHeight/2-100,5, "calibri", 10)
sleep(3000)
SplashOff()
EndSelect
WEnd
EndFunc
;~ Bilder (klein) erstellen
Func GUICtrlCreatePng($iCtrl, $filepath_pic, $iPNG_Left = 0, $iPNG_Top = 0, $factor=0)
Local $hImagePNG = _GDIPlus_ImageLoadFromFile($filepath_pic)
Global $iPNG_Width = _GDIPlus_ImageGetWidth($hImagePNG)
Global $iPNG_Height = _GDIPlus_ImageGetHeight($hImagePNG)
Local $iPNG_faktor= $iPNG_Width/$factor
Local $hBmp = _GDIPlus_ImageResize($hImagePNG, $iPNG_Width/$iPNG_faktor,$iPNG_Height/$iPNG_faktor) ;GDI+ Bitmap
Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) ;GDI Bitmap!
If $iCtrl Then GUICtrlSendMsg($iCtrl, 0x0172, 0, $hHBitmap)
_WinAPI_DeleteObject($hHBitmap)
_GDIPlus_BitmapDispose($hBmp)
_GDIPlus_ImageDispose($hImagePNG)
EndFunc ;==>GUICtrlCreatePng
[/autoit]Du kannst auch _GDIPlus_ImageScale() zum Skalieren benutzen, wenn du das Bild faktorisiert ändern möchtest.
Gruß,
UEZ