CalonMerc Posted November 8, 2009 Share Posted November 8, 2009 If FileExists(@ProgramFilesDir & "\W7VRadio\") Then If NOT FileExists(@ProgramFilesDir & "\W7VRadio\RadioBG.png") Then FileInstall("C:\Users\Calon\Pictures\vdjneg.png", @TempDir & "\RadioBG.png") FileMove(@TempDir & "\RadioBG.png", @ProgramFilesDir & "\W7VRadio\RadioBG.png") FileDelete(@TempDir & "\RadioBG.png") Else DirCreate(@ProgramFilesDir & "\W7VRadio\") FileInstall("C:\Users\Calon\Pictures\vdjneg.png", @TempDir & "\RadioBG.png") FileMove(@TempDir & "\RadioBG.png", @ProgramFilesDir & "\W7VRadio\RadioBG.png") FileDelete(@TempDir & "\RadioBG.png") EndIf EndIf My main question, is how can something basically the same as above be accomplished? This does not work and I don't know how to make it work. I am figuring that FileInstall cannot be within an IF or something, but I don't know. Opt("GUIOnEventMode", 1) $GUI = GUICreate("Win7Vista Radio", 300, 40, (@DesktopWidth - 315) / 2, (@DesktopHeight - 100) / 2, -1, BitOR($WS_POPUP, $WS_VISIBLE)) $BGPic = GUICtrlCreatePic(@ProgramFilesDir & "\W7VRadio\RadioBG.png",0,0) $SongName = GUICtrlCreateLabel("Artist" & @CRLF & "Name", 60, 7, 150, 26) $Volume = GUICtrlCreateSlider(200, 10, 100, 20) GUICtrlSetData($Volume, 100) $Play = GUICtrlCreateButton("Play", 10, 10, 40, 20) $VolLevel = 100 GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUICtrlSetOnEvent($Play, "Play") Is this the correct way to call up the image used earlier to be used as a background? Link to comment Share on other sites More sharing options...
Yashied Posted November 8, 2009 Share Posted November 8, 2009 GUICtrlCreatePic() not work with PNG images. Use Icons.au3 to resolve this problem.#Include <Icons.au3> Opt("GUIOnEventMode", 1) $GUI = GUICreate("Win7Vista Radio", 300, 40, (@DesktopWidth - 315) / 2, (@DesktopHeight - 100) / 2, $WS_POPUP) $BGPic = GUICtrlCreatePic("", 0, 0, (@DesktopWidth - 315) / 2, (@DesktopHeight - 100) / 2) GUICtrlSetState(-1, $GUI_DISABLE) _SetImage($BGPic, @ProgramFilesDir & "\W7VRadio\RadioBG.png") $SongName = GUICtrlCreateLabel("Artist" & @CRLF & "Name", 60, 7, 150, 26) $Volume = GUICtrlCreateSlider(200, 10, 100, 20) GUICtrlSetData($Volume, 100) $Play = GUICtrlCreateButton("Play", 10, 10, 40, 20) $VolLevel = 100 GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUICtrlSetOnEvent($Play, "Play") GUISetState()But in this case it's easier save PNG as BMP and use it. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
CalonMerc Posted November 8, 2009 Author Share Posted November 8, 2009 (edited) If FileExists(@ProgramFilesDir & "\W7VRadio\") Then If NOT FileExists(@ProgramFilesDir & "\W7VRadio\RadioBG.png") Then FileInstall("C:\Users\Calon\Pictures\vdjneg.png", @TempDir & "\RadioBG.bmp") FileMove(@TempDir & "\RadioBG.bmp", @ProgramFilesDir & "\W7VRadio\RadioBG.bmp") FileDelete(@TempDir & "\RadioBG.bmp") Else DirCreate(@ProgramFilesDir & "\W7VRadio\") FileInstall("C:\Users\Calon\Pictures\vdjneg.png", @TempDir & "\RadioBG.bmp") FileMove(@TempDir & "\RadioBG.bmp", @ProgramFilesDir & "\W7VRadio\RadioBG.bmp") FileDelete(@TempDir & "\RadioBG.bmp") EndIf EndIf Could I do this? the above source doesn't work to create the DIR or to move anything to it. I created the dir manually, and it moved the file to it. Now I will try deleting it and seeing what happens. Edited November 8, 2009 by CalonMerc Link to comment Share on other sites More sharing options...
CalonMerc Posted November 8, 2009 Author Share Posted November 8, 2009 I would have edited my post, but it won't let me edit it again.I fixed the FileInstall part, I had messed up the first If statement.But now, I get this in the folder (displayed from Windows). This is the GUI that the picture is supposed to be the background of:And this is the GUI source code I have currently:$GUI = GUICreate("Win7Vista Radio", 300, 40, (@DesktopWidth - 315) / 2, (@DesktopHeight - 100) / 2, -1) $BGPic = GUICtrlCreatePic(@ProgramFilesDir & "\W7VRadio\RadioBG.bmp",0,0) $SongName = GUICtrlCreateLabel("Artist" & @CRLF & "Name", 60, 7, 150, 26) $Volume = GUICtrlCreateSlider(200, 10, 100, 20) GUICtrlSetData($Volume, 100) $Play = GUICtrlCreateButton("Play", 10, 10, 40, 20) $VolLevel = 100 GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUICtrlSetOnEvent($Play, "Play") Link to comment Share on other sites More sharing options...
Valuater Posted November 8, 2009 Share Posted November 8, 2009 A couple of ideas... $My_pic = @TempDir & "\My_Pic.jpg" FileInstall("C:\Program Files\AutoIt3\Examples\PIC_NAME.jpg", $My_pic) $GUI = GUICreate("Win7Vista Radio", 300, 40, (@DesktopWidth - 315) / 2, (@DesktopHeight - 100) / 2, -1) $BGPic = GUICtrlCreatePic($My_pic,0,0) GUICtrlSetState( -1, $GUI_DISABLE) 8) Link to comment Share on other sites More sharing options...
CalonMerc Posted November 8, 2009 Author Share Posted November 8, 2009 I could try that, but I moved the pic from the tempdir to the programsdirectory. And shouldn't it work fine, I know the file is where I am calling it from. But might the locked file form prevent it from being used? Link to comment Share on other sites More sharing options...
Valuater Posted November 8, 2009 Share Posted November 8, 2009 Sorry, I am not sure how to work with that "locked file".... 8( ... someone will come along who knows what to do... 8) 8) Link to comment Share on other sites More sharing options...
CalonMerc Posted November 8, 2009 Author Share Posted November 8, 2009 (edited) Well, thanks for trying. I can't figure anything about the locked file.. it's NOT read-only.. I just tried to take ownership of the file, and the locked icon went away. How would I do that for a user's computer? It was in a file conversion of mine, how do I make the GUIctrls have transparent backgrounds? Edit: I got my label to have a transparent background (was in the help file), but how do I make a slider and a button be transparent? I want the button to still look like a button, just showing the image behind it. Edited November 8, 2009 by CalonMerc Link to comment Share on other sites More sharing options...
CalonMerc Posted November 10, 2009 Author Share Posted November 10, 2009 I've been searching the forums now for about 3 hours straight to no avail. If anyone knows a quick way to make buttons and sliders transparent, please inform me. I tried a UDF that made them transparent, but moved them up a lot. Link to comment Share on other sites More sharing options...
CalonMerc Posted November 11, 2009 Author Share Posted November 11, 2009 I've been searching the forums now for about 3 hours straight to no avail. If anyone knows a quick way to make buttons and sliders transparent, please inform me. I tried a UDF that made them transparent, but moved them up a lot.Not only that, but it did make the entire control transparent, I'm wanting just the background. Link to comment Share on other sites More sharing options...
CalonMerc Posted November 14, 2009 Author Share Posted November 14, 2009 Does anyone know a solution to this? Link to comment Share on other sites More sharing options...
SuperAutoit Posted November 14, 2009 Share Posted November 14, 2009 Below your label or other you can put: GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) and it becomes transparent i dont know if its your question Bye Link to comment Share on other sites More sharing options...
CalonMerc Posted November 16, 2009 Author Share Posted November 16, 2009 I've tried that, but it doesn't work for the slider. Link to comment Share on other sites More sharing options...
CalonMerc Posted November 21, 2009 Author Share Posted November 21, 2009 Does anyone have any kind of solution to offer? I can't figure this out. 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