Jump to content

Search the Community

Showing results for tags 'wallpaper'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 9 results

  1. cramaboule

    wallpaper V8

    Version 8.1.0

    142 downloads

    Autoit Airliners.net wallpaper changer Works from XP to W10
  2. Hi, i have tried to use many scripts to change a pcs wallpaper but they dont work. This script sets the wallpaper but does not refresh it. Any idea what the problem is? #include <SendMessage.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Misc.au3> #RequireAdmin $UrlDownload = "http://examplesite.org/test.bmp" ;DL link $Directory = "C:\test.bmp" ;Name of your file Local $download = InetGet($UrlDownload, $Directory,0,1) ; download in the background Do Sleep(100) Until InetGetInfo($download, 2) ;Checks to see if $download is completed (param 2) InetClose($download) RunWait($Directory) ;it will pause the script untill the process of the downloaded file is finished RegWrite ("HKEY_CURRENT_USER\Control Panel\Desktop", "wallpaper", "REG_SZ", "C:\test.bmp" ) Dim $hWnd = WinGetHandle('[CLASS:Progman]') _SendMessage($hWnd, $WM_COMMAND, 0x0001A220) Thanks Matthew
  3. While looking for a way to change my desktop background of only my secondary monitor, I found a few simple solutions that are built into Windows. But when you look up how to do such with a slideshow... You only find programs that cost money. So, I set out to make it myself.This is a pretty basic program. It simply displays an image in the center of the screen (scaled to fit screen) and uses a black background.The program does allow mouse passthrough, though you can't drag and drop over it, so it wouldn't really work well if you have icons on your second monitor. #include <File.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <Misc.au3> #include <Array.au3> #include <GDIPlus.au3> ;User Changeable Variables ;======================================================================== $pictureFolder = "D:\Wallpapers" $changeTime = 5 ;Seconds Global $smWidth = 1600 Global $smHeight = 900 Global $monitorPosition = "Right" ;Global $monitorPosition = "Left" ;======================================================================== Global $imageList = _FileListToArray($pictureFolder) Global $imageCount = $imageList[0] Global $imageHeight, $imageWidth, $pHeight, $pWidth, $pic, $gdiPic _GDIPlus_Startup() OnAutoItExitRegister("CloseProgram") $GUIStyle = BitOR($WS_POPUP, $WS_VISIBLE, $HWND_BOTTOM) ;Popup, Visible, Window on Bottom $GUIStyleEx = BitOR($WS_EX_TRANSPARENT, $WS_EX_TOOLWINDOW) ;Allow Passthrough, Hide from Alt+Tab $Parent = WinGetHandle('Program Manager', '') ;Sets parent to the program manager, allowing you to right click the desktop If $monitorPosition = "Right" Then $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, @DesktopWidth, 0, $GUIStyle, $GUIStyleEx, $Parent) Else $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, (-1 * @DesktopWidth), 0, $GUIStyle, $GUIStyleEx, $Parent) EndIf GUISetBkColor(0, $GUI) _WinAPI_SetWindowPos($GUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_SHOWWINDOW)) ;Forces window to bottom of screen WinSetTrans($GUI, '', 255) ;Sets Window Visible Transparency: Required for mouse passthrough ChangeImage() GUISetState(@SW_SHOW) ;Show GUI While 1 Sleep($changeTime * 1000) ChangeImage() WEnd Func ChangeImage() $picName = Random(1, $imageCount, 1) ;Get Dimensions of image GetDimensions($imageList[$picName]) $imageHeight = $pHeight $imageWidth = $pWidth ;Turn them all into integers. (Fixes glitch that caused some images to skip resizing) $imageHeight = Int($imageHeight) $imageWidth = Int($imageWidth) $smHeight = Int($smHeight) $smWidth = Int($smWidth) ;Adjust the image size ;----------------------------------------------- ;If the image is bigger than the screen, adjust it If $imageWidth > $smWidth = 1 Or $imageHeight > $smHeight = 1 Then ;Calculate Aspect Ratio of image $aspectRatioX = $smWidth / $imageWidth $aspectRatioY = $smHeight / $imageHeight If $aspectRatioX < $aspectRatioY Then $scaleFactor = $aspectRatioX Else $scaleFactor = $aspectRatioY EndIf $imageHeight = $imageHeight * $scaleFactor $imageWidth = $imageWidth * $scaleFactor ;Else ;Image is smaller/same size as monitor EndIf ;Calculate Center of monitor ;(Monitor size - image size) / 2 $smCenterX = ($smWidth - $imageWidth) / 2 $smCenterY = ($smHeight - $imageHeight) / 2 ;Resize the image $hHBmp = $pictureFolder & "\" & $imageList[$picName] $gdiPic = _GDIPlus_BitmapCreateFromFile($hHBmp) ;convert GDI bitmap to GDI+ bitmap _GDIPlus_BitmapDispose($pic) $pic = _GDIPlus_ImageResize($gdiPic, $imageWidth, $imageHeight) ;resize image _GDIPlus_BitmapDispose($gdiPic) GUISetBkColor(0, $GUI) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI) ;create a graphics object from a window handle $gdiPic = _GDIPlus_BitmapCreateFromFile($pictureFolder & "\" & $imageList[$picName]) _GDIPlus_GraphicsDrawImage($hGraphics, $pic, $smCenterX, $smCenterY) ;display scaled image _GDIPlus_GraphicsDispose($hGraphics) ;Garbage Cleanup EndFunc ;==>ChangeImage Func GetDimensions($picName) Local $prop, $dArray, $fileSize, $imageDimensionsGDI $path = $pictureFolder & "\" & $picName $fileSize = FileGetSize($path) ;Save information to registry for faster access. Compare size of picture to verify changes to picture If $fileSize <> RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size") Then ;File sizes do not match RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) Else ;File sizes match $pWidth = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width") $pHeight = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height") If $pWidth = "-1" Or $pHeight = "-1" Then RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) EndIf EndIf EndFunc ;==>GetDimensions Func CloseProgram() ;Garbage Cleanup _GDIPlus_GraphicsDispose($gdiPic) _GDIPlus_Shutdown() EndFunc ;==>CloseProgram Secondary Wallpaper.au3
  4. wakillon

    WallpaperCropper

    Version 1.0.1.4

    770 downloads

    Easily Crop a picture to a wanted dimension and set your Windows desktop background wallpaper without stretching or distorting it. Drag'n drop a Picture for load it. Drag it for position it and use mouse wheel for zoom - unzoom it.(TouchPad users need to plug a Mouse ) Select dimensions and format you want for save your wallpaper. Pictures with transparency are supported. By default Pictures are saved on your desktop. Tips : Hold Left Ctrl key for move the photo more slowly. Hold Left Shift key for move the photo more quickly. Hold Left Shift key for Zoom/UnZoom more quickly. Hold Left Shift key when drag'n drop photo for work with a best quality. (Moves and Zoom are more slow) Executable : WallpaperCropper.exe
  5. wakillon

    WallpaperBank

    Version 1.0.2.2

    611 downloads

    WallpaperBank allows you to use more than 26,000 online wallpapers from 3 websites : http://www.goodfon.com/ http://www.badfon.ru/ http://bizhi.baidu.com/ Wallpapers are downloaded and displayed after a random selection. The fifteenth category is disabled by default but can be enabled line 159. You can add current Wallpaper to a favorites or a banned directory (Attention there is yet some doublons). You can also use your own Wallpapers by selecting the "Yours" type. Landscape is the default type. Jpg, png, gif, bmp Wallpaper formats are supported. Access Settings by Tray Menu. Double click on tray icon for quickly change to a random Wallpaper of the selected category. External files and also includes are embbeded in script for compatibility with previous AutoIt version. Tested on xpsp3, win7x64 and win8.1x64 Executable : WallpaperBank.exe
  6. A bit tired to search for new wallpapers, last month i have tried BaiduWP, a online Wallpaper Changer. Nice wallpapers but there was only a chinese version and i was a bit lost for understand his settings and how remove his unwanted toolbar ! So why not create my own in a language i (sometimes) understand ? After manually sorted by category more than 65000 wallpapers, ( a good method to be completely disgusted of wallpapers ) i keep (only) about 26.000 of them. In advance sorry if some wallpapers are not in the appropriate category... Here is the result : WallpaperBank allows you to use more than 26,000 online wallpapers from 3 websites : http://www.goodfon.com/ http://www.badfon.ru/ http://bizhi.baidu.com/ Wallpapers are downloaded and displayed after a random selection. The fifteenth category is disabled by default but can be enabled line 167. You can add current Wallpaper to a favorites or a banned directory (Attention there is yet some doublons). You can also use your own Wallpapers by selecting the "Yours" type. Landscape is the default type. Jpg, png, gif, bmp Wallpaper formats are supported. Access Settings by Tray Menu. Double click on tray icon for quickly change to a random Wallpaper of the selected category. External files and also includes are embbeded in script for compatibility with previous AutoIt version. Tested on xpsp3, win7x64 and win8.1x64 Previous downloads : 310 source : WallpaperBank v1.0.2.2.au3.html executable : WallpaperBank.exe.html (Once the html file is downloaded, double click on it for start the download) Hope you like it !
  7. WallpaperCropper Easily Crop a picture to a wanted Screen dimension and set your Windows desktop background wallpaper without stretching or distorting it. Does your desktop background picture look stretched ? Do you find it time-consuming to crop pictures to the right proportions for your desktop ? WallpaperCropper is the solution. Crop and set any picture easily to your desktop dimensions in some few clicks. Don't waste time loading big, slow photo-editing software to manually crop it or resize it. Don't stay stuck with the choices Windows gives you ! Drag'n drop a Picture for load it. Drag it for position it and use mouse wheel for zoom - unzoom it.(TouchPad users need to plug a Mouse ) Select dimensions and format you want for save your wallpaper. Pictures with transparency are supported. By default Pictures are saved on your desktop. Tips : Hold Left Ctrl key for move the photo more slowly. Hold Left Shift key for move the photo more quickly. Hold Left Shift key for Zoom/UnZoom more quickly. Hold Left Shift key when drag'n drop photo for work with a best quality. (Moves and Zoom are more slow) All externals files are included in script, and all Buttons were made online with chimply.com the easy and free buttons Generator ! Previous downloads : 70 source : WallpaperCropper 1.0.1.5.au3 executable : WallpaperCropper.exe.html (Once this html file downloaded, double click on it for start the download) Hope you will like it !
  8. I made this script after a by an user that want some kind of script for charity purpose ( i really hope ), by the way very good idea this can be helpfull to publicize charity organization or local store . With Wallpaper Changer you can dinamically change your windows wallpaper without any trouble. You can also download your wallpaper from your own website and restribuite it to all the people that will use your software. PLEASE if you use this script on commercial software publicize autoit and why not a local charity organization. Changelog ;===================================================== v.1.2.0 (08/05/2013) Added new style ;Thanks to GreenCan Added image autoresize if the image has a higher resolution the the screen Added new option to _ImageSaveToBMP Fixed convert the image to bmp only when it is necessary ;===================================================== v.1.1.0 (07/05/2013) Fixed Inetclose causes crash under some circumstances Fixed Some code cleanup Added New Style ;Thanks GreenCan for the documentation Added Support to 'gif', 'jpeg', 'jpg', 'png', 'tiff' format Added php code completely rewritten ;===================================================== v.1.0.1 (06/05/2013) Fixed Some code cleanup ;===================================================== v.1.0.0 (06/05/2013) Initial Release The .php file has been tested on Xamp with php 5.3.8, you need PHP 4 >= 4.3.0, PHP 5 to run the script. You have to put the .php in the same directory where the wallpaper are stored on your server. After that you have to set in the autoit script the variable: ; #INDEX# ======================================================================================================================= ; Title .........: Wallpaper Changer v.1.2.0 ; AutoIt Version : v3.3.8.1 ; Description ...: A little program to dinamically change your wallpapers ; Author(s) .....: Nessie ; =============================================================================================================================== #include <GDIPlus.au3> #region Settings $iWait = 2000 ;Change the background every 50 seconds $iLoop = -1 ;The number of changing wallpaper loop, set -1 to infinite loop $sWallpapersPath = @ScriptDir & "\Wallpapers\" ;Remember to put the "\" at the end! $bOnline = False ;Set to True if you want to download the wallpapers from your website, otherwise set this value to False $sURL = "http://127.0.0.1/TEST/wallpaper.php" ;The url where the .php script is stored !!WARNING!! You have to put this .php in the same directory where the wallpapers are stored $bRestoreWallpaper = True ;Set to True if you want to restore the original wallpaper at the script exit, otherwise set this value to False $iWallStyle = 2 ;Default wallpaper style, for more info see _ChangeWallpaper header $bAutoResize = True ;Autosize the wallpaper, if it have a higher resolution than screen. (Only for Vista and later!) #endregion Settings OnAutoItExitRegister("_Terminate") HotKeySet(("^!e"), "_Terminate") ;CTRL+ALT+E to terminate the process. If $bRestoreWallpaper Then Global $sTileWallPaper = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallPaper") Global $sWallpaperStyle = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle") Global $sOriginalWallpaper = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") EndIf If Not FileExists($sWallpapersPath) Then MsgBox(16, "Error", "This path: " & $sWallpapersPath & " doesn't exist.") Exit EndIf If $bOnline Then $sSource = BinaryToString(InetRead($sURL, 1)) If @error Then MsgBox(16, "Error", "Unable to download the source of the page.") Exit EndIf $aImageNames = StringRegExp($sSource, "<tr>(.*?)</tr>", 3) If @error Then MsgBox(16, "Error", "Unable to grab the images name.") Exit EndIf $aRegex = StringRegExp($sURL, "(.+/)", 3) ;Retrive the path where the images are stored, in this example http://127.0.0.1/b/Wallpaper/ If @error Then MsgBox(16, "Error", "Unable to grab the images path.") Exit EndIf $sURL_ImagePath = $aRegex[0] For $i = 0 To UBound($aImageNames) - 1 ;Convert all the image name to .bmp format, to check if the converted images is already store on the user pc $sImageName = StringRegExpReplace($aImageNames[$i], "(.*)\..*$", "$1.bmp") ;If image name already .bmp don't touch it, already change extension If FileExists($sWallpapersPath & $sImageName) Then ;The .bmp image equivalent already exist, we don't need to re-download the original file images ContinueLoop EndIf Local $hDownload = InetGet($sURL_ImagePath & $aImageNames[$i], $sWallpapersPath & $aImageNames[$i]) If @error Then ContinueLoop InetClose($hDownload) Next EndIf $search = FileFindFirstFile($sWallpapersPath & "*.*") ;We do that so we can grab all .bmp even if they are not in the website page, so the user can run custom wallpaper too If $search = -1 Then MsgBox(0, "Error", "I can't find any images.") Exit EndIf $iCount = -1 $iDimension = 10 Local $aWallpapers[$iDimension] While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop $sFileExt = StringLower(StringRight($file, 4)) If $sFileExt <> '.bmp' And _GetWinVersion() < 6.0 Then $file = _ImageSaveToBMP($sWallpapersPath & $file, $sWallpapersPath, Default, False, True) If @error Then ContinueLoop Else If _GetWinVersion() >= 6.0 And $sFileExt <> '.bmp' And $sFileExt <> '.jpg' Then $file = _ImageSaveToBMP($sWallpapersPath & $file, $sWallpapersPath, Default, False, True) If @error Then ContinueLoop EndIf EndIf $iCount += 1 If $iCount > $iDimension - 1 Then $iDimension += 10 ReDim $aWallpapers[$iDimension] EndIf $aWallpapers[$iCount] = $sWallpapersPath & $file WEnd FileClose($search) ReDim $aWallpapers[$iCount + 1] $i = 0 While 1 = 1 If $iLoop > -1 Then If $i > $iLoop Then ExitLoop EndIf $i += 1 EndIf For $x = 0 To UBound($aWallpapers) - 1 _ChangeWallpaper($aWallpapers[$x], $iWallStyle, $bAutoResize) If @error Then MsgBox(16, "Error", "Unable to change the wallpaper.") Exit EndIf Sleep($iWait) Next WEnd ; #FUNCTION# ==================================================================================================================== ; Name...........: _ChangeWallpaper ; Description ...: Change Windows Wallpaper ; Syntax.........: _ChangeWallpaper($sImage, [$iStyle]) ; Parameters ....: $sImage - The path of the .bmp file ; $$iStyle - The numeric value of desidered style ; 0 Tiled ; 1 Centered ; 2 Stretched ; 3 Fit (Windows 7 and later) ; 4 Fill (Windows 7 and later) ; 5 Screen Width ; $bResize - Automatically resize th image if has a higher resolution than screen ; Return values .: On Success - Return the new file name. ; On Failure - ; @error = 1 The image doesn't exist ; @error = 2 The image is not a .bmp file ; @error = 3 Invalid style ; @error = 4 Style not supported by OS ; @error = 5 Unable to change the wallpaper ; Author ........: Nessie ; =============================================================================================================================== Func _ChangeWallpaper($sImage, $iStyle = 0, $bResize = True) If Not FileExists($sImage) Then Return SetError(1, 0, "") Local $sImageExt = StringLower(StringRight($sImage, 4)) Local $fWinVer = _GetWinVersion() If $sImageExt <> '.bmp' And $fWinVer < 6.0 Then Return SetError(2, 0, "") Else If $fWinVer >= 6.0 And $sImageExt <> '.bmp' And $sImageExt <> '.jpg' Then Return SetError(2, 0, "") EndIf EndIf If $iStyle < 0 Or $iStyle > 5 Then Return SetError(3, 0, "") If $fWinVer < 6.0 Then ; More info http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx If $iStyle > 2 Then Return SetError(4, 0, "") EndIf Local $sWallpaperKey = "HKEY_CURRENT_USER\Control Panel\Desktop" Local $iTileWallPaper, $iWallpaperStyle If $bResize And $fWinVer >= 6.0 Then $aImageSize = _ImageGetSize($sImage) If @error Then Return SetError(5, 0, "") If $aImageSize[0] > @DesktopWidth Or $aImageSize[1] > @DesktopHeight Then $iStyle = 5 ;Force style n°5 EndIf EndIf Switch $iStyle Case 0 $iTileWallPaper = 1 $iWallpaperStyle = 0 Case 1 $iTileWallPaper = 0 $iWallpaperStyle = 0 Case 2 $iTileWallPaper = 0 $iWallpaperStyle = 2 Case 3 $iTileWallPaper = 0 $iWallpaperStyle = 6 Case 4 $iTileWallPaper = 0 $iWallpaperStyle = 10 Case 5 $iTileWallPaper = 0 $iWallpaperStyle = 4 EndSwitch RegWrite($sWallpaperKey, "TileWallPaper", "REG_SZ", $iTileWallPaper) If @error Then Return SetError(5, 0, "") RegWrite($sWallpaperKey, "WallpaperStyle", "REG_SZ", $iWallpaperStyle) If @error Then Return SetError(5, 0, "") ;Thanks to guinness for his advice ; Idea from here: http://www.autoitscript.com/forum/topic/19370-autoit-wrappers/page__st__280#entry652536 ; $SPI_SETDESKWALLPAPER, $SPIF_UPDATEINIFILE and $SPIF_SENDCHANGE can be found on APIConstants.au3 included on WinAPIEx by Yashied ;Return _WinAPI_SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, DllStructGetPtr($tBuffer), BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Local $tBuffer = DllStructCreate('wchar Text[' & StringLen($sImage) + 1 & ']') DllStructSetData($tBuffer, 'Text', $sImage) Return _WinAPI_SystemParametersInfo(0x0014, 0, DllStructGetPtr($tBuffer), BitOR(0x0001, 0x0002)) If @error Then Return SetError(5, 0, "") Return True EndFunc ;==>_ChangeWallpaper ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ImageSaveToBMP ; Description ...: Convert an image to bmp format ; Syntax ........: _ImageSaveToBMP($sPath[, $sDestPath = @ScriptDir[, $sName = Default[, $bOverwrite = False[, $bDelOrig = False]]]]) ; Parameters ....: $sPath - A string value. ; $sDestPath - The path where to save the converted image. Default is @ScriptDir. ; $sName - The name of the converted image. Default is the original photo name. ; $bOverwrite - Overwrite the converted file if already exist. Default is False. ; $bDelOrig - Delete the original file after conversion. Default is False. ; Return values .: On Success - Return the new file names ; On Failure - ; @error = 1 The file to be converted doesn't not exist ; @error = 2 The image is already a bmp file ; @error = 3 Invalid file extension ; @error = 4 The destination path doesn't not exist ; @error = 5 Invalid file name ; @error = 6 The destination file already exist ; @error = 7 Unable to overwrite the destination file ; @error = 8 Unable to save the bmp file ; Author ........: Nessie ; Example .......: _ImageSaveToBMP(@DesktopDir & "\nessie.jpg") ; =============================================================================================================================== Func _ImageSaveToBMP($sPath, $sDestPath = @ScriptDir, $sName = Default, $bOverwrite = False, $bDelOrig = False) Local $bCheckExt = False If Not FileExists($sPath) Then Return SetError(1, 0, "") Local $sImageExt = StringLower(StringTrimLeft($sPath, StringInStr($sPath, '.', 0, -1))) If $sImageExt = "bmp" Then SetError(2, 0, "") Local $aAllowedExt[5] = ['gif', 'jpeg', 'jpg', 'png', 'tiff'] For $i = 0 To UBound($aAllowedExt) - 1 If $sImageExt = $aAllowedExt[$i] Then $bCheckExt = True ExitLoop EndIf Next If $bCheckExt = False Then Return SetError(3, 0, "") If Not FileExists($sDestPath) Then Return SetError(4, 0, "") If $sName = Default Then $sName = StringTrimLeft($sPath, StringInStr($sPath, '\', 0, -1)) $sName = StringTrimRight($sName, 4) Else If $sName = "" Then Return SetError(5, 0, "") EndIf If Not $bOverwrite Then If FileExists($sDestPath & "\" & $sName & ".bmp") Then Return SetError(6, 0, "") EndIf Else FileDelete($sDestPath & "\" & $sName & ".bmp") If @error Then Return SetError(7, 0, "") EndIf EndIf _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sPath) Local $sCLSID = _GDIPlus_EncodersGetCLSID("BMP") _GDIPlus_ImageSaveToFileEx($hImage, $sDestPath & "\" & $sName & ".bmp", $sCLSID) If @error Then _GDIPlus_Shutdown() Return SetError(8, 0, "") EndIf _GDIPlus_Shutdown() If $bDelOrig Then FileDelete($sPath) If @error Then Return SetError(8, 0, "") EndIf Return $sName & ".bmp" EndFunc ;==>_ImageSaveToBMP ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ImageGetSize ; Description ...: Retive the size of an image (Width & Height) ; Syntax ........: _ImageGetSize($sImage) ; Parameters ....: $sImage - The path of the image. ; Return values .: Return an array with the image size ; On Success - ; $array[0] = Image Width ; $array[1] = Image Height ; On Failure - ; @error = 1 The file doesn't exist ; @error = 2 Unable to load the image ; @error = 3 Unable to get the image Width ; @error = 4 Unable to get the image Height ; Author ........: Nessie ; Example .......: _ImageGetSize("C:\Nessie.jpg") ; =============================================================================================================================== Func _ImageGetSize($sImage) Local $aResult[2] If Not FileExists($sImage) Then Return SetError(1, 0, "") _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sImage) If @error Then Return SetError(2, 0, "") $iWidth = _GDIPlus_ImageGetWidth($hImage) If @error Then Return SetError(3, 0, "") $iHeight = _GDIPlus_ImageGetHeight($hImage) If @error Then Return SetError(4, 0, "") _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() $aResult[0] = $iWidth $aResult[1] = $iHeight Return $aResult EndFunc ;==>_ImageGetSize Func _GetWinVersion() Local $sRet = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\', 'CurrentVersion') If @error Then Return SetError(0, 0, "") Return $sRet EndFunc ;==>_GetWinVersion Func _Terminate() If $bRestoreWallpaper Then RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallPaper", $sTileWallPaper) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", $sWallpaperStyle) DllCall("user32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $sOriginalWallpaper, "int", BitOR(1, 2)) EndIf Exit EndFunc ;==>_TerminateAnd this is the source for the php script that you can upload on your own server to redistribuite your wallpaper. <?php /* Wallpaper List Author: Nessie Description : A php script to implement with Wallpaper Changer. Visit http://www.autoitscript.com/forum/topic/150597-wallpaper-changer/ for more info */ ?> <html> <head> <title>Wallpaper List powered by Nessie</title> </head> <body> <?php $root_dir = "./"; $search = scandir($root_dir); $aAllowedExt = array("bmp","gif","jpeg","jpg","png","tiff"); foreach ($search as $images) { $filepath = $root_dir.'/'.$images; if(is_file($filepath)) { $ext = strtolower(substr($images, strrpos($images, '.')+1)); if (in_array($ext,$aAllowedExt)) { echo "<tr>" . $images . "</tr><br>"; } } } ?> </body> </html>Previous download: 20 Wallpaper Changer v.1.2.0.rar
  9. Hi ppl, just made this simple one because sometimes i want to access the wallpaper directory to do some modifications on wallpapers, and in win 7 it's not as easy to go there as i would likem so i made this simple script, got any sugestions of improvement? They're welcome. So here it goes, execute to open dir where the wallpaper you have displayed is: #include <File.au3> Local $Path, $szDrive, $szDir, $szFName, $szExt, $TestPath $Path = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerDesktopGeneral", "WallpaperSource") $TestPath = _PathSplit($Path, $szDrive, $szDir, $szFName, $szExt) $Path = $szDrive & $szDir ;MsgBox(4096, "", $Path, 10) ShellExecute ($Path) Hope you like it and that it may become useful for someone. EDIT: Removed the brackets as pointed out by guinness. Thanks, forgot that one. AutoIt Wallpaper.au3
×
×
  • Create New...