diff --git a/resources/windows.ps1 b/resources/windows.ps1 index 952990d8..480b58fd 100644 --- a/resources/windows.ps1 +++ b/resources/windows.ps1 @@ -1,26 +1,26 @@ - -param($imagePath) - -# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 - -Add-Type -Assembly PresentationCore -$img = [Windows.Clipboard]::GetImage() - -if ($img -eq $null) { - "no image" - Exit 1 -} - -if (-not $imagePath) { - "no image" - Exit 1 -} - -$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) -$stream = [IO.File]::Open($imagePath, "OpenOrCreate") -$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder -$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null -$encoder.Save($stream) | out-null -$stream.Dispose() | out-null - -$imagePath + +param($imagePath) + +# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 + +Add-Type -Assembly PresentationCore +$img = [Windows.Clipboard]::GetImage() + +if ($img -eq $null) { + "no image" + Exit 1 +} + +if (-not $imagePath) { + "no image" + Exit 1 +} + +$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) +$stream = [IO.File]::Open($imagePath, "OpenOrCreate") +$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder +$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null +$encoder.Save($stream) | out-null +$stream.Dispose() | out-null + +$imagePath diff --git a/resources/windows10.ps1 b/resources/windows10.ps1 index 8cc003bc..c347d2f1 100644 --- a/resources/windows10.ps1 +++ b/resources/windows10.ps1 @@ -1,45 +1,45 @@ -# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 -param($imagePath) - -# https://github.com/PowerShell/PowerShell/issues/7233 -# fix the output encoding bug -[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding - -Add-Type -Assembly PresentationCore -function main { - $img = [Windows.Clipboard]::GetImage() - - if ($img -eq $null) { - "no image" - Exit 1 - } - - if (-not $imagePath) { - "no image" - Exit 1 - } - - $fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) - $stream = [IO.File]::Open($imagePath, "OpenOrCreate") - $encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder - $encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null - $encoder.Save($stream) | out-null - $stream.Dispose() | out-null - - $imagePath - Exit 1 -} - -try { - # For WIN10 - $file = Get-Clipboard -Format FileDropList - if ($file -ne $null) { - Convert-Path $file - Exit 1 - } -} catch { - # For WIN7 WIN8 WIN10 - main -} - +# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1 +param($imagePath) + +# https://github.com/PowerShell/PowerShell/issues/7233 +# fix the output encoding bug +[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding + +Add-Type -Assembly PresentationCore +function main { + $img = [Windows.Clipboard]::GetImage() + + if ($img -eq $null) { + "no image" + Exit 1 + } + + if (-not $imagePath) { + "no image" + Exit 1 + } + + $fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0) + $stream = [IO.File]::Open($imagePath, "OpenOrCreate") + $encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder + $encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null + $encoder.Save($stream) | out-null + $stream.Dispose() | out-null + + $imagePath + Exit 1 +} + +try { + # For WIN10 + $file = Get-Clipboard -Format FileDropList + if ($file -ne $null) { + Convert-Path $file + Exit 1 + } +} catch { + # For WIN7 WIN8 WIN10 + main +} + main \ No newline at end of file diff --git a/src/renderer/components/common/customButton.vue b/src/renderer/components/common/CustomButton.vue similarity index 100% rename from src/renderer/components/common/customButton.vue rename to src/renderer/components/common/CustomButton.vue diff --git a/src/renderer/components/common/customInput.vue b/src/renderer/components/common/CustomInput.vue similarity index 100% rename from src/renderer/components/common/customInput.vue rename to src/renderer/components/common/CustomInput.vue diff --git a/src/renderer/components/common/customModal.vue b/src/renderer/components/common/CustomModal.vue similarity index 100% rename from src/renderer/components/common/customModal.vue rename to src/renderer/components/common/CustomModal.vue diff --git a/src/renderer/components/common/customNavCard.vue b/src/renderer/components/common/CustomNavCard.vue similarity index 100% rename from src/renderer/components/common/customNavCard.vue rename to src/renderer/components/common/CustomNavCard.vue diff --git a/src/renderer/components/common/customRadioOption.vue b/src/renderer/components/common/CustomRadioOption.vue similarity index 100% rename from src/renderer/components/common/customRadioOption.vue rename to src/renderer/components/common/CustomRadioOption.vue diff --git a/src/renderer/components/common/customRange.vue b/src/renderer/components/common/CustomRange.vue similarity index 100% rename from src/renderer/components/common/customRange.vue rename to src/renderer/components/common/CustomRange.vue diff --git a/src/renderer/components/common/customSelect.vue b/src/renderer/components/common/CustomSelect.vue similarity index 100% rename from src/renderer/components/common/customSelect.vue rename to src/renderer/components/common/CustomSelect.vue diff --git a/src/renderer/components/common/customSwitch.vue b/src/renderer/components/common/CustomSwitch.vue similarity index 100% rename from src/renderer/components/common/customSwitch.vue rename to src/renderer/components/common/CustomSwitch.vue diff --git a/src/renderer/components/common/multiSelect.vue b/src/renderer/components/common/MultiSelect.vue similarity index 100% rename from src/renderer/components/common/multiSelect.vue rename to src/renderer/components/common/MultiSelect.vue diff --git a/src/renderer/components/common/placeholderTable.vue b/src/renderer/components/common/PlaceholderTable.vue similarity index 100% rename from src/renderer/components/common/placeholderTable.vue rename to src/renderer/components/common/PlaceholderTable.vue diff --git a/src/renderer/components/common/settingCard.vue b/src/renderer/components/common/SettingCard.vue similarity index 100% rename from src/renderer/components/common/settingCard.vue rename to src/renderer/components/common/SettingCard.vue diff --git a/src/renderer/components/common/settingSection.vue b/src/renderer/components/common/SettingSection.vue similarity index 100% rename from src/renderer/components/common/settingSection.vue rename to src/renderer/components/common/SettingSection.vue diff --git a/src/renderer/components/common/singleSelect.vue b/src/renderer/components/common/SingleSelect.vue similarity index 100% rename from src/renderer/components/common/singleSelect.vue rename to src/renderer/components/common/SingleSelect.vue diff --git a/src/renderer/index.html b/src/renderer/index.html index aa32f716..1d69c651 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -1,12 +1,12 @@ - - - - - - PicList - - -
- - - + + + + + + PicList + + +
+ + +