JustinReno Posted January 7, 2008 Share Posted January 7, 2008 For around an hour, I've tried to get my slideshow to work. Everything else works but creating the slideshow image. I've tried every combination I could think of to get the code to work. The image just doesn't display. Here is my redroducer: #Include <GDIPlus.au3> #Include <GUIConstants.au3> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;SYNTAX OF THE INI FILE: ;;; ; ;;; ; [Picture Names and Paths] ;;; ; PictureName.jpg=ANY FULL PATH TO A PICTURE ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Ini = @ScriptDir&"\Pictures.ini" IniWrite($Ini, "Picture Names and Paths", "Merlin.gif", @SystemDir&"\oobe\images\merlin.gif") _GDIPlus_Startup() $ReadPicturePaths = IniReadSection($Ini, "Picture Names and Paths") $SlideshowGUI = GUICreate("", @DesktopWidth + 100, @DesktopHeight + 100, -1 , -1, $WS_POPUP) $Image = _GDIPlus_ImageLoadFromFile($ReadPicturePaths[1][1]) $SlideshowPicture = GUICtrlCreatePic($ReadPicturePaths[1][1], 100, 100, _GDIPlus_ImageGetWidth($Image)/3, _GDIPlus_ImageGetHeight($Image)/3) GUISetState(@SW_SHOW, $SlideshowGUI) While 1 Sleep(100) Wend Please,Pleas, Please help THanks. Link to comment Share on other sites More sharing options...
JustinReno Posted January 8, 2008 Author Share Posted January 8, 2008 No one knows? Link to comment Share on other sites More sharing options...
Siao Posted January 8, 2008 Share Posted January 8, 2008 (edited) When you _GDIPlus_ImageLoadFromFile, GDI+ locks the image file, so GUICtrlCreatePic() fails. Do _GDIPlus_ImageDispose($Image) before trying to show image with GUICtrlCreatePic/GUICtrlSetImage, or draw pic using GDI functions and do not use these AutoIt functions at all. Edited January 8, 2008 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now