BingWallpaper.psm1

# https://github.com/Jaykul/MultiMonitorHelper
# Requires -Assembly MultiMonitorHelper.dll

Add-Type -Name Windows -Namespace System -MemberDefinition '
    [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    public static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni);
'

$urlbase = "http://www.bing.com/"

# A few resolutions of these wallpapers exist, as far as I know ...
$KnownAvailable = [Ordered]@{
  0.56 = @('768x1366','1080x1920')
  0.75 = @('480x640','600x800','768x1024')
  1.33 = @('640x480','800x600','1024x768')
  1.6  = @('1920x1200')
  1.78 = @('1366x768','1920x1080')
}
$Sizes = @($KnownAvailable.Values | % { $_ })
$Ratios = @($knownAvailable.Keys)

function Get-Size {
    param($Size)
    if($Sizes -Contains $Size) {
        return $Size
    }

    [int]$Width, [int]$Height = $Size -split 'x'
    $Ratio = [Math]::Round(($Width / $Height), 2)
    Write-Debug ("{0}x{1} = {2}" -f $Width, $Height, $Ratio)

    $r = [array]::BinarySearch( $Ratios, $Ratio )
    Write-Debug "Index of $Ratio = $r in $Ratios"
    if($r -ge 0) { 
       $Key = $Ratios[$r]
    } else {
        $r = [Math]::Abs($r+2)
        if(($Ratios[$r] - $Ratio) -gt ($Ratio - $Ratios[($r-1)])) {
           $Key = $Ratios[($r-1)]
        } else {
           $Key = $Ratios[$r]
        }
    }

    foreach($Sz in $KnownAvailable[$Key]) {
        $W = [int]($Sz -split 'x')[0]
        Write-Debug ("Can't match {0}x{1}, try {2}" -f $Width, $Height, $W)
        if($W -ge $Width) {
            return $Sz
        }
    }
    return $KnownAvailable[$Key][-1]
}

function Get-ActiveDisplays {
    #.Synopsis
    # Get the currently available displays

    #.Notes
    # Windows.Forms.Screen alters the size of low-DPI monitors in mixed-DPI systems
    # System.Windows.SystemParameters alters the size of hight-DPI monitors in mixed-DPI systems

    # # For example, the following code proved buggy on my systems:
    # [System.Windows.Forms.Screen]::AllScreens | Select DeviceName -Expand Bounds

    # # Given a 3200x1800 high DPI laptop screen and two 1080p screens (one rotated):
    # # It produces this information:

    # Name X Y Width Height
    # ---- - - ----- ------
    # \\.\DISPLAY1 0 0 3200 1800
    # \\.\DISPLAY2 -3840 1448 3840 2160
    # \\.\DISPLAY3 -6000 330 2160 3840

    # # The code below, using https://github.com/ChrisEelmaa/MultiMonitorHelper
    # # Produces the following correct information on my system:
    # Name X Y Height Width Rotation
    # ---- - - ------ ----- --------
    # \\.\DISPLAY1 0 0 1800 3200 Default
    # \\.\DISPLAY2 -1920 724 1080 1920 Default
    # \\.\DISPLAY3 -3000 165 1920 1080 Rotated90

    if(!("MultiMonitorHelper.DisplayFactory" -As [Type])) {
        Add-Type -AssemblyName System.Windows.Forms
        # This should work on "simple" systems without mixed DPI displays
        @([System.Windows.Forms.Screen]::AllScreens | Select DeviceName -Expand Bounds)
    } else {
        @(@([MultiMonitorHelper.DisplayFactory]::GetDisplayModel().GetActiveDisplays()) |
                Select Name,
                       @{Name = "X"; Expr = { $_.Origin.X }},
                       @{Name = "Y"; Expr = { $_.Origin.Y }},
                       @{Name = "Height"; Expr = { if($_.Rotation -in "Default", "Rotated180") { $_.Resolution.Height } else { $_.Resolution.Width } }},
                       @{Name = "Width"; Expr = { if($_.Rotation -in "Default", "Rotated180") { $_.Resolution.Width } else { $_.Resolution.Height } }},
                       Rotatione, IsPrimary, IsActive)
    }
}

function Set-BingWallpaper {
    #.Synopsis
    # Fetches Bing Homepage images and generates a WallPaper
    #.Description
    # With support for mixed-DPI multi-display configurations, this command will download one or more Bing homepage images from the last several days and generate a custom wallpaper for all your connected screens.
    #.Example
    # Set-BingWallpaper
    # Sets the wallpaper on each of your displays to a different recent Bing homepage image
    #.Example
    # Set-BingWallpaper -Offset 1
    # Sets the wallpaper on each of your displays using the image(s) from yesterday
    #.Notes
    # Uses the CCD APIs which are new in Windows 7 and requires WDDM with display miniport drivers.
    # https://msdn.microsoft.com/en-us/library/windows/hardware/hh406259%28v=vs.85%29.aspx
    [CmdletBinding()]
    param(
        # If you want to try the bing images from other countries, fiddle around with this.
        # As far as I know, the valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA
        # NOTE: as far as I can tell, the images are usually the same, except offset by a day or two in some locales.
        [ValidateSet('en-US', 'zh-CN', 'ja-JP', 'en-AU', 'en-UK', 'de-DE', 'en-NZ', 'en-CA')]
        [String]$Culture,
        # If you want to (re)use yesterday's wallpapers, fiddle around with this
        [Int]$Offset = 0,
        # Force re-downloading and creating the wallpaper even if none of the files have changed
        [Switch]$Force
    )
    begin {
    }
    end {
        # Figure out how many wallpapers we need
        $Screens = @(Get-ActiveDisplays)

        # Use THAT information to calculate our virtual wallpaper size.
        # NOTE: See .Notes in Get-ActiveDisplays as to why we can't use SystemParameters here
        $count = $screens.Count
        $MinX, $MaxX = $Screens | % { $_.X, ($_.X + $_.Width) } | sort | select -first 1 -last 1
        $MinY, $MaxY = $Screens | % { $_.Y, ($_.Y + $_.Height) } | sort | select -first 1 -last 1

        $Width = $MaxX - $MinX
        $Height = $MaxY - $MinY
        $Top = $MinY
        $Left = $MinX

        # Fetch Bing's Image Archive information
        # It would be fun to tell you about these images, right?
        # TODO: We should do a notification with the details about the new wallpaper
        $APIUrl = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=${Offset}&n=${count}"
        if($Culture) {
            $APIUrl += "&mkt=${Culture}"
        }

        $BingImages = Invoke-RestMethod $APIUrl

        $datespan = $Culture + $BingImages.images[-1].startdate + "-" + $BingImages.images[0].enddate

        $TempPath = [System.IO.Path]::GetTempPath()

        $WallPaperPath = Join-Path $TempPath "${datespan}.jpg"

        if(-not $Force -and (Test-Path $WallPaperPath)) {
            Write-Verbose "Update wallpaper from cached image file $WallPaperPath"
        } else {
            $ErrorActionPreference = "Stop"
            Write-Verbose ("Create {0}x{1} Wallpaper from Bing images" -f $Width, $Height)
            try {
                Write-Debug ("Full Wallpaper Size {0}x{1} offset to {2},{3}" -f $Width, $Height, $Left, $Top)
                $Wallpaper = New-Object System.Drawing.Bitmap ([int[]]($Width, $Height))
                $Graphics = [System.Drawing.Graphics]::FromImage($Wallpaper)

                for($i = 0; $i -lt $Count; $i++) {
                    $Size = "{0}x{1}" -f $Screens[$i].Width, $Screens[$i].Height
                    # Figure out the best image size available ...
                    Write-Debug "Actual Size $Size"
                    $Size = Get-Size $Size
                    Write-Debug "Image Size $Size"

                    # # I wanted to use ProjectOxford to trim the wallpaper, but it's output is grainy
                    # $OCPKey = (BetterCredentials\Get-Credential ComputerVisionApis@api.ProjectOxford.ai -Store).GetNetworkCredential().Password
                    # Invoke-WebRequest -OutFile $WallPaperPath -Method "POST" -ContentType "application/json" `
                    # -Headers @{ "Ocp-Apim-Subscription-Key" = $OCPKey } `
                    # -Body (ConvertTo-Json @{ Url = "http://www.bing.com/iod/1920/1200/{0:yyyyMMdd}" -f (get-date) }) `
                    # -Uri "https://api.projectoxford.ai/vision/v1/thumbnails?width=1024&height=768&smartCropping=true"

                    $File = Join-Path $TempPath ((Split-Path $BingImages.Images[$i].UrlBase -Leaf) + "_" + $Size + ".jpg")

                    if(-not $Force -and (Test-Path $File)){
                        Write-Verbose "Using cached image file $File"
                    } else {
                        $ImageUrl = $urlbase + $BingImages.Images[$i].UrlBase + "_" + $Size + ".jpg"
                        Write-Verbose "Download Image $ImageUrl to $File"
                        Invoke-WebRequest $ImageUrl -OutFile $File
                    }

                    Write-Debug ("Place $(Split-Path $File -Leaf) at {0}, {1} for ({2},{3})" -f ($Screens[$i].X - $Left), ($Screens[$i].Y - $Top), $Screens[$i].Width, $Screens[$i].Height)

                    try {
                        $Source = [System.Drawing.Image]::FromFile($File)
                        # Putting the wallpaper in the right place, relatively speaking, is the tricky bit
                        $Graphics.DrawImage($Source, $Screens[$i].X - $Left, $Screens[$i].Y - $Top, $Screens[$i].Width, $Screens[$i].Height)
                    } finally {
                        $Source.Dispose()
                    }
                }
            } finally {
                $Graphics.Dispose()
                # Save as jpeg to save a little disk space
                $Wallpaper.Save($WallPaperPath, [System.Drawing.Imaging.ImageFormat]::Jpeg)
            }
        }
        # Tell windows about our new wallpaper ...
        Set-ItemProperty "HKCU:\Control Panel\Desktop" WallpaperStyle 1
        Set-ItemProperty "HKCU:\Control Panel\Desktop" TileWallpaper 1
        # Please excuse the magic numbers, I can't remember the constants anymore
        # $Result should be 1, but we're not checking it, because what would we do about it?
        $Result = [Windows]::SystemParametersInfo( 20, 0, $WallPaperPath, 3 )        
    }
}

# SIG # Begin signature block
# MIIXxAYJKoZIhvcNAQcCoIIXtTCCF7ECAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUmudFgMprEtmT5fta354ZUoTh
# 8ASgghL3MIID7jCCA1egAwIBAgIQfpPr+3zGTlnqS5p31Ab8OzANBgkqhkiG9w0B
# AQUFADCBizELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIG
# A1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhh
# d3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcg
# Q0EwHhcNMTIxMjIxMDAwMDAwWhcNMjAxMjMwMjM1OTU5WjBeMQswCQYDVQQGEwJV
# UzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xMDAuBgNVBAMTJ1N5bWFu
# dGVjIFRpbWUgU3RhbXBpbmcgU2VydmljZXMgQ0EgLSBHMjCCASIwDQYJKoZIhvcN
# AQEBBQADggEPADCCAQoCggEBALGss0lUS5ccEgrYJXmRIlcqb9y4JsRDc2vCvy5Q
# WvsUwnaOQwElQ7Sh4kX06Ld7w3TMIte0lAAC903tv7S3RCRrzV9FO9FEzkMScxeC
# i2m0K8uZHqxyGyZNcR+xMd37UWECU6aq9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