-
-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Set Profile Pictures | ||
description: Sets the default Atlas profile pictures | ||
actions: | ||
- !powerShell: | ||
command: '.\PFP.ps1' | ||
exeDir: true | ||
wait: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Add-Type -AssemblyName System.Drawing | ||
$img = [System.Drawing.Image]::FromFile((Get-Item '.\user.png')) | ||
|
||
$resolutions = @{ | ||
"user.png" = 448 | ||
"user.bmp" = 448 | ||
"guest.png" = 448 | ||
"guest.bmp" = 448 | ||
"user-192.png" = 192 | ||
"user-48.png" = 48 | ||
"user-40.png" = 40 | ||
"user-32.png" = 32 | ||
} | ||
|
||
# Set default profile pictures | ||
foreach ($image in $resolutions.Keys) { | ||
$resolution = $resolutions[$image] | ||
|
||
$a = New-Object System.Drawing.Bitmap($resolution, $resolution) | ||
$graph = [System.Drawing.Graphics]::FromImage($a) | ||
$graph.DrawImage($img, 0, 0, $resolution, $resolution) | ||
$a.Save("$([Environment]::GetFolderPath('CommonApplicationData'))\Microsoft\User Account Pictures\$image") | ||
} |