This commit is contained in:
Курнат Андрей
2026-03-25 18:26:40 +03:00
parent d46172beb9
commit 054d10cb6d
6 changed files with 719 additions and 3 deletions

View File

@@ -16,6 +16,15 @@
<SolidColorBrush x:Key="AppMutedTextBrush" Color="#FF6B7B88" />
<SolidColorBrush x:Key="AppButtonBrush" Color="#FFF7FAFD" />
<SolidColorBrush x:Key="AppButtonHoverBrush" Color="#FFE7F0F9" />
<SolidColorBrush x:Key="AppPrimaryButtonBrush" Color="#FF5B8DB8" />
<SolidColorBrush x:Key="AppPrimaryButtonHoverBrush" Color="#FF6A9BC4" />
<SolidColorBrush x:Key="AppPrimaryButtonPressedBrush" Color="#FF4C799E" />
<SolidColorBrush x:Key="AppPrimaryButtonDisabledBrush" Color="#FF9EB3C4" />
<SolidColorBrush x:Key="AppPrimaryButtonBorderBrush" Color="#FF426E91" />
<SolidColorBrush x:Key="AppMenuIconAccentBrush" Color="#FF4F7FA7" />
<SolidColorBrush x:Key="AppMenuIconSuccessBrush" Color="#FF47A772" />
<SolidColorBrush x:Key="AppMenuIconDangerBrush" Color="#FFC76868" />
<SolidColorBrush x:Key="AppMenuIconWarningBrush" Color="#FFCC9B52" />
<SolidColorBrush x:Key="AppSelectionBrush" Color="#FFD8E6F4" />
<SolidColorBrush x:Key="AppSelectionTextBrush" Color="#FF17324A" />
<SolidColorBrush x:Key="OpenDocumentTenDaysBrush" Color="#FFF2F8EA" />
@@ -77,6 +86,53 @@
<Setter Property="Padding" Value="10,4" />
</Style>
<Style x:Key="PrimaryActionButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="{StaticResource AppPrimaryButtonBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource AppPrimaryButtonBorderBrush}" />
<Setter Property="Foreground" Value="#FFFAFCFE" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Padding" Value="12,5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="RootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="4"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="RootBorder" Property="Background" Value="{StaticResource AppPrimaryButtonHoverBrush}" />
<Setter TargetName="RootBorder" Property="BorderBrush" Value="#FF4F7FA7" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="RootBorder" Property="Background" Value="{StaticResource AppPrimaryButtonPressedBrush}" />
<Setter TargetName="RootBorder" Property="BorderBrush" Value="#FF3E6687" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="RootBorder" Property="Background" Value="{StaticResource AppPrimaryButtonDisabledBrush}" />
<Setter TargetName="RootBorder" Property="BorderBrush" Value="#FF8CA0B1" />
<Setter Property="Foreground" Value="#FFF5F8FB" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{StaticResource AppPrimaryButtonDisabledBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource AppPrimaryButtonDisabledBrush}" />
<Setter Property="Foreground" Value="#FFF4F7FA" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
@@ -118,6 +174,166 @@
<Style TargetType="{x:Type MenuItem}">
<Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<Trigger Property="Header" Value="Добавить">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Grid Width="16" Height="16">
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
</Grid>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Изменить">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Удалить">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Распечатать">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="4" Canvas.Top="1.5" Width="8" Height="4" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="2" Canvas.Top="5" Width="12" Height="5" RadiusX="1.5" RadiusY="1.5" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="4" Canvas.Top="8.5" Width="8" Height="5" Fill="#FFF9FCFE" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Добавить по заводским номерам">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="2" Canvas.Top="3" Width="8" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="2" Canvas.Top="7" Width="8" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="2" Canvas.Top="11" Width="6" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Ellipse Canvas.Left="10.5" Canvas.Top="6" Width="4" Height="4" Fill="{StaticResource AppMenuIconSuccessBrush}" />
<Rectangle Canvas.Left="12" Canvas.Top="4.5" Width="1" Height="7" Fill="{StaticResource AppMenuIconSuccessBrush}" />
<Rectangle Canvas.Left="9.5" Canvas.Top="7" Width="6" Height="1" Fill="{StaticResource AppMenuIconSuccessBrush}" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Добавить по типу">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="2" Canvas.Top="3" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="2" Canvas.Top="9" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="8" Canvas.Top="6" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="12" Canvas.Top="1.5" Width="1.5" Height="5" Fill="{StaticResource AppMenuIconSuccessBrush}" />
<Rectangle Canvas.Left="10.25" Canvas.Top="3.25" Width="5" Height="1.5" Fill="{StaticResource AppMenuIconSuccessBrush}" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Клонировать поверку в выбранные строки">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="3" Canvas.Top="4" Width="7" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="6" Canvas.Top="2" Width="7" Height="8" RadiusX="1" RadiusY="1" Fill="#FFEAF3FB" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Распечатать документ о поверке">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Rectangle Canvas.Left="4" Canvas.Top="1.5" Width="8" Height="4" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="2" Canvas.Top="5" Width="12" Height="5" RadiusX="1.5" RadiusY="1.5" Fill="{StaticResource AppMenuIconAccentBrush}" />
<Rectangle Canvas.Left="4" Canvas.Top="8.5" Width="8" Height="5" Fill="#FFF9FCFE" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
<Ellipse Canvas.Left="10.5" Canvas.Top="9.5" Width="4" Height="4" Fill="{StaticResource AppMenuIconSuccessBrush}" />
<Path Fill="White" Data="M12.1,10.4 L12.9,11.2 L14.2,9.6 L14.8,10.1 L12.9,12.4 L11.5,11 Z" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Годен">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Grid Width="16" Height="16">
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconSuccessBrush}" />
<Path Fill="White" Data="M5.1,8.2 L7.2,10.3 L11.6,5.6 L12.8,6.6 L7.3,12.3 L3.9,8.9 Z" />
</Grid>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Забракован">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Grid Width="16" Height="16">
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconDangerBrush}" />
<Path Stroke="White" StrokeThickness="1.8" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Data="M5.1,5.1 L10.9,10.9 M10.9,5.1 L5.1,10.9" />
</Grid>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Отменить проверку">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Path Fill="{StaticResource AppMenuIconWarningBrush}" Data="M7.8,2.2 C10.8,2.2 13.2,4.6 13.2,7.6 C13.2,10.6 10.8,13 7.8,13 C5.5,13 3.6,11.6 2.8,9.5 L4.5,9.5 C5.2,10.8 6.4,11.5 7.8,11.5 C10,11.5 11.7,9.8 11.7,7.6 C11.7,5.4 10,3.7 7.8,3.7 C6.5,3.7 5.3,4.3 4.6,5.4 L6.7,5.4 L3.8,8.2 L1.1,5.4 L3.1,5.4 C4,3.4 5.8,2.2 7.8,2.2 Z" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Header" Value="Виды клейм...">
<Setter Property="Icon">
<Setter.Value>
<Viewbox Width="14" Height="14">
<Canvas Width="16" Height="16">
<Ellipse Canvas.Left="2.5" Canvas.Top="2.5" Width="11" Height="11" Fill="{StaticResource AppMenuIconWarningBrush}" />
<Path Fill="White" Data="M8,4 L8.9,6.2 L11.3,6.3 L9.4,7.8 L10.1,10.1 L8,8.8 L5.9,10.1 L6.6,7.8 L4.7,6.3 L7.1,6.2 Z" />
</Canvas>
</Viewbox>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type ListBox}">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

View File

@@ -266,6 +266,7 @@
HorizontalAlignment="Right">
<Button Width="120"
Margin="0,0,0,8"
Style="{StaticResource PrimaryActionButtonStyle}"
IsEnabled="{Binding IsDocumentHeaderEditable}"
Command="{Binding SaveDocumentHeaderCommand}"
Content="Сохранить" />
@@ -477,9 +478,6 @@
Width="120"
IsReadOnly="True"
Binding="{Binding SerialNumber}" />
<DataGridTextColumn Header="Комплектность"
Width="240"
Binding="{Binding Completeness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<DataGridTextColumn Header="Дата поверки"
Width="110"
IsReadOnly="True"
@@ -500,6 +498,9 @@
Width="240"
IsReadOnly="True"
Binding="{Binding VerificationDocumentDisplay}" />
<DataGridTextColumn Header="Комплектность"
Width="240"
Binding="{Binding Completeness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataGrid.Columns>
</DataGrid>
</Grid>

View File

@@ -0,0 +1,499 @@
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.Drawing
function New-RoundedRectPath {
param(
[System.Drawing.RectangleF] $Rect,
[float] $Radius
)
$diameter = $Radius * 2.0
$path = New-Object System.Drawing.Drawing2D.GraphicsPath
if ($diameter -le 0.0) {
$path.AddRectangle($Rect)
return $path
}
$path.AddArc($Rect.X, $Rect.Y, $diameter, $diameter, 180, 90)
$path.AddArc($Rect.Right - $diameter, $Rect.Y, $diameter, $diameter, 270, 90)
$path.AddArc($Rect.Right - $diameter, $Rect.Bottom - $diameter, $diameter, $diameter, 0, 90)
$path.AddArc($Rect.X, $Rect.Bottom - $diameter, $diameter, $diameter, 90, 90)
$path.CloseFigure()
return $path
}
function New-Color {
param(
[int] $A,
[int] $R,
[int] $G,
[int] $B
)
return [System.Drawing.Color]::FromArgb($A, $R, $G, $B)
}
function Add-ShadowRoundedRect {
param(
[System.Drawing.Graphics] $Graphics,
[System.Drawing.RectangleF] $Rect,
[float] $Radius,
[int] $Layers,
[float] $OffsetX,
[float] $OffsetY
)
for ($layer = $Layers; $layer -ge 1; $layer--) {
$inflate = [float]($layer * 2.2)
$shadowRect = [System.Drawing.RectangleF]::new(
$Rect.X + $OffsetX - ($inflate / 2.0),
$Rect.Y + $OffsetY - ($inflate / 2.0),
$Rect.Width + $inflate,
$Rect.Height + $inflate)
$shadowPath = New-RoundedRectPath -Rect $shadowRect -Radius ($Radius + ($inflate / 3.5))
try {
$alpha = [Math]::Min(80, [int](5 + ($layer * 2.8)))
$brush = New-Object System.Drawing.SolidBrush (New-Color -A $alpha -R 0 -G 0 -B 0)
try {
$Graphics.FillPath($brush, $shadowPath)
}
finally {
$brush.Dispose()
}
}
finally {
$shadowPath.Dispose()
}
}
}
function Add-ShadowEllipse {
param(
[System.Drawing.Graphics] $Graphics,
[System.Drawing.RectangleF] $Rect,
[int] $Layers,
[float] $OffsetX,
[float] $OffsetY
)
for ($layer = $Layers; $layer -ge 1; $layer--) {
$inflate = [float]($layer * 1.8)
$alpha = [Math]::Min(65, [int](4 + ($layer * 2.0)))
$brush = New-Object System.Drawing.SolidBrush (New-Color -A $alpha -R 0 -G 0 -B 0)
try {
$Graphics.FillEllipse(
$brush,
$Rect.X + $OffsetX - ($inflate / 2.0),
$Rect.Y + $OffsetY - ($inflate / 2.0),
$Rect.Width + $inflate,
$Rect.Height + $inflate)
}
finally {
$brush.Dispose()
}
}
}
function Draw-Line {
param(
[System.Drawing.Graphics] $Graphics,
[System.Drawing.Color] $Color,
[float] $Width,
[float] $X1,
[float] $Y1,
[float] $X2,
[float] $Y2,
[System.Drawing.Drawing2D.LineCap] $StartCap = [System.Drawing.Drawing2D.LineCap]::Round,
[System.Drawing.Drawing2D.LineCap] $EndCap = [System.Drawing.Drawing2D.LineCap]::Round
)
$pen = New-Object System.Drawing.Pen($Color, $Width)
try {
$pen.StartCap = $StartCap
$pen.EndCap = $EndCap
$Graphics.DrawLine($pen, $X1, $Y1, $X2, $Y2)
}
finally {
$pen.Dispose()
}
}
function Save-MultiSizeIcon {
param(
[System.Drawing.Bitmap] $MasterBitmap,
[string] $OutputPath,
[int[]] $Sizes
)
$tempFiles = New-Object System.Collections.Generic.List[string]
try {
foreach ($size in $Sizes) {
$scaled = New-Object System.Drawing.Bitmap($size, $size)
try {
$graphics = [System.Drawing.Graphics]::FromImage($scaled)
try {
$graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality
$graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
$graphics.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality
$graphics.Clear([System.Drawing.Color]::Transparent)
$graphics.DrawImage($MasterBitmap, 0, 0, $size, $size)
}
finally {
$graphics.Dispose()
}
$tempFile = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetTempFileName(), '.png')
$scaled.Save($tempFile, [System.Drawing.Imaging.ImageFormat]::Png)
$tempFiles.Add($tempFile)
}
finally {
$scaled.Dispose()
}
}
$stream = [System.IO.File]::Create($OutputPath)
try {
$writer = New-Object System.IO.BinaryWriter($stream)
try {
$writer.Write([UInt16]0)
$writer.Write([UInt16]1)
$writer.Write([UInt16]$Sizes.Length)
$dataOffset = 6 + (16 * $Sizes.Length)
$imageBlobs = @()
for ($index = 0; $index -lt $Sizes.Length; $index++) {
$size = $Sizes[$index]
$pngBytes = [System.IO.File]::ReadAllBytes($tempFiles[$index])
$imageBlobs += ,$pngBytes
$writer.Write([byte]($(if ($size -ge 256) { 0 } else { $size })))
$writer.Write([byte]($(if ($size -ge 256) { 0 } else { $size })))
$writer.Write([byte]0)
$writer.Write([byte]0)
$writer.Write([UInt16]1)
$writer.Write([UInt16]32)
$writer.Write([UInt32]$pngBytes.Length)
$writer.Write([UInt32]$dataOffset)
$dataOffset += $pngBytes.Length
}
foreach ($blob in $imageBlobs) {
$writer.Write($blob)
}
}
finally {
$writer.Dispose()
}
}
finally {
$stream.Dispose()
}
}
finally {
foreach ($tempFile in $tempFiles) {
if ([System.IO.File]::Exists($tempFile)) {
Remove-Item $tempFile -Force
}
}
}
}
$root = Split-Path -Parent $PSScriptRoot
$assetsDir = Join-Path $root 'Assets'
$previewPath = Join-Path $assetsDir 'XlabAppIconPreview.png'
$iconPath = Join-Path $assetsDir 'XlabApp.ico'
$size = 1024
$bitmap = New-Object System.Drawing.Bitmap($size, $size)
try {
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
try {
$graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
$graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
$graphics.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality
$graphics.Clear([System.Drawing.Color]::Transparent)
$tileRect = [System.Drawing.RectangleF]::new(86, 86, 852, 852)
$tileRadius = 194.0
Add-ShadowRoundedRect -Graphics $graphics -Rect $tileRect -Radius $tileRadius -Layers 14 -OffsetX 8 -OffsetY 18
$tilePath = New-RoundedRectPath -Rect $tileRect -Radius $tileRadius
try {
$tileBrush = New-Object System.Drawing.Drawing2D.LinearGradientBrush(
$tileRect,
(New-Color -A 255 -R 12 -G 28 -B 52),
(New-Color -A 255 -R 20 -G 96 -B 132),
48.0)
try {
$graphics.FillPath($tileBrush, $tilePath)
}
finally {
$tileBrush.Dispose()
}
$glowEllipse = New-Object System.Drawing.Drawing2D.GraphicsPath
try {
$glowEllipse.AddEllipse([System.Drawing.RectangleF]::new(198, 154, 486, 350))
$glowBrush = New-Object System.Drawing.Drawing2D.PathGradientBrush($glowEllipse)
try {
$glowBrush.CenterColor = New-Color -A 90 -R 255 -G 255 -B 255
$glowBrush.SurroundColors = @((New-Color -A 0 -R 255 -G 255 -B 255))
$graphics.FillPath($glowBrush, $glowEllipse)
}
finally {
$glowBrush.Dispose()
}
}
finally {
$glowEllipse.Dispose()
}
$radialCore = New-Object System.Drawing.Drawing2D.GraphicsPath
try {
$radialCore.AddEllipse([System.Drawing.RectangleF]::new(232, 232, 560, 560))
$radialBrush = New-Object System.Drawing.Drawing2D.PathGradientBrush($radialCore)
try {
$radialBrush.CenterColor = New-Color -A 64 -R 68 -G 226 -B 255
$radialBrush.SurroundColors = @((New-Color -A 0 -R 68 -G 226 -B 255))
$graphics.FillPath($radialBrush, $radialCore)
}
finally {
$radialBrush.Dispose()
}
}
finally {
$radialCore.Dispose()
}
$rimPen = New-Object System.Drawing.Pen((New-Color -A 80 -R 98 -G 219 -B 255), 8.0)
try {
$graphics.DrawPath($rimPen, $tilePath)
}
finally {
$rimPen.Dispose()
}
$innerPath = New-RoundedRectPath -Rect ([System.Drawing.RectangleF]::new(116, 116, 792, 792)) -Radius 170.0
try {
$innerPen = New-Object System.Drawing.Pen((New-Color -A 42 -R 255 -G 255 -B 255), 3.0)
try {
$graphics.DrawPath($innerPen, $innerPath)
}
finally {
$innerPen.Dispose()
}
}
finally {
$innerPath.Dispose()
}
}
finally {
$tilePath.Dispose()
}
$orbitRect = [System.Drawing.RectangleF]::new(250, 252, 524, 524)
$orbitShadowPen = New-Object System.Drawing.Pen((New-Color -A 42 -R 0 -G 0 -B 0), 18.0)
try {
$graphics.DrawEllipse($orbitShadowPen, 268, 272, 524, 524)
}
finally {
$orbitShadowPen.Dispose()
}
$orbitPen = New-Object System.Drawing.Pen((New-Color -A 76 -R 206 -G 241 -B 255), 14.0)
try {
$graphics.DrawEllipse($orbitPen, $orbitRect)
}
finally {
$orbitPen.Dispose()
}
$center = 512.0
$bladeRect = [System.Drawing.RectangleF]::new(-64, -286, 128, 356)
$bladeRadius = 64.0
$bladeDefinitions = @(
@{ Angle = -18.0; Start = (New-Color -A 255 -R 88 -G 240 -B 255); End = (New-Color -A 255 -R 28 -G 144 -B 218); Highlight = (New-Color -A 120 -R 255 -G 255 -B 255) },
@{ Angle = 102.0; Start = (New-Color -A 255 -R 109 -G 246 -B 198); End = (New-Color -A 255 -R 30 -G 179 -B 133); Highlight = (New-Color -A 110 -R 244 -G 255 -B 250) },
@{ Angle = 222.0; Start = (New-Color -A 255 -R 255 -G 190 -B 98); End = (New-Color -A 255 -R 240 -G 120 -B 52); Highlight = (New-Color -A 100 -R 255 -G 242 -B 218) }
)
foreach ($blade in $bladeDefinitions) {
$shadowState = $graphics.Save()
try {
$graphics.TranslateTransform($center + 14.0, $center + 18.0)
$graphics.RotateTransform([float]$blade.Angle)
$shadowPath = New-RoundedRectPath -Rect $bladeRect -Radius $bladeRadius
try {
$shadowBrush = New-Object System.Drawing.SolidBrush (New-Color -A 72 -R 0 -G 0 -B 0)
try {
$graphics.FillPath($shadowBrush, $shadowPath)
}
finally {
$shadowBrush.Dispose()
}
}
finally {
$shadowPath.Dispose()
}
}
finally {
$graphics.Restore($shadowState)
}
$state = $graphics.Save()
try {
$graphics.TranslateTransform($center, $center)
$graphics.RotateTransform([float]$blade.Angle)
$path = New-RoundedRectPath -Rect $bladeRect -Radius $bladeRadius
try {
$bladeBrush = New-Object System.Drawing.Drawing2D.LinearGradientBrush(
$bladeRect,
$blade.Start,
$blade.End,
90.0)
try {
$graphics.FillPath($bladeBrush, $path)
}
finally {
$bladeBrush.Dispose()
}
$shinePath = New-RoundedRectPath -Rect ([System.Drawing.RectangleF]::new(-44, -270, 34, 316)) -Radius 18.0
try {
$shineBrush = New-Object System.Drawing.Drawing2D.LinearGradientBrush(
([System.Drawing.RectangleF]::new(-44, -270, 34, 316)),
$blade.Highlight,
(New-Color -A 0 -R 255 -G 255 -B 255),
90.0)
try {
$graphics.FillPath($shineBrush, $shinePath)
}
finally {
$shineBrush.Dispose()
}
}
finally {
$shinePath.Dispose()
}
$edgePen = New-Object System.Drawing.Pen((New-Color -A 86 -R 255 -G 255 -B 255), 4.0)
try {
$graphics.DrawPath($edgePen, $path)
}
finally {
$edgePen.Dispose()
}
}
finally {
$path.Dispose()
}
}
finally {
$graphics.Restore($state)
}
}
$innerShadowBrush = New-Object System.Drawing.SolidBrush (New-Color -A 70 -R 0 -G 0 -B 0)
try {
$graphics.FillEllipse($innerShadowBrush, 404, 406, 216, 216)
}
finally {
$innerShadowBrush.Dispose()
}
$innerRingRect = [System.Drawing.RectangleF]::new(394, 392, 216, 216)
$innerRingBrush = New-Object System.Drawing.Drawing2D.LinearGradientBrush(
$innerRingRect,
(New-Color -A 255 -R 250 -G 252 -B 255),
(New-Color -A 255 -R 204 -G 214 -B 226),
125.0)
try {
$graphics.FillEllipse($innerRingBrush, $innerRingRect)
}
finally {
$innerRingBrush.Dispose()
}
$innerCorePath = New-Object System.Drawing.Drawing2D.GraphicsPath
try {
$innerCorePath.AddEllipse([System.Drawing.RectangleF]::new(428, 426, 148, 148))
$innerCoreBrush = New-Object System.Drawing.Drawing2D.PathGradientBrush($innerCorePath)
try {
$innerCoreBrush.CenterColor = New-Color -A 255 -R 14 -G 46 -B 82
$innerCoreBrush.SurroundColors = @((New-Color -A 255 -R 25 -G 93 -B 138))
$graphics.FillPath($innerCoreBrush, $innerCorePath)
}
finally {
$innerCoreBrush.Dispose()
}
}
finally {
$innerCorePath.Dispose()
}
$coreGlowPath = New-Object System.Drawing.Drawing2D.GraphicsPath
try {
$coreGlowPath.AddEllipse([System.Drawing.RectangleF]::new(444, 442, 116, 116))
$coreGlowBrush = New-Object System.Drawing.Drawing2D.PathGradientBrush($coreGlowPath)
try {
$coreGlowBrush.CenterColor = New-Color -A 255 -R 92 -G 227 -B 255
$coreGlowBrush.SurroundColors = @((New-Color -A 0 -R 92 -G 227 -B 255))
$graphics.FillPath($coreGlowBrush, $coreGlowPath)
}
finally {
$coreGlowBrush.Dispose()
}
}
finally {
$coreGlowPath.Dispose()
}
$coreRingPen = New-Object System.Drawing.Pen((New-Color -A 112 -R 255 -G 255 -B 255), 6.0)
try {
$graphics.DrawEllipse($coreRingPen, $innerRingRect)
}
finally {
$coreRingPen.Dispose()
}
$sparkPath = New-Object System.Drawing.Drawing2D.GraphicsPath
try {
$sparkPath.AddEllipse([System.Drawing.RectangleF]::new(672, 248, 74, 74))
$sparkBrush = New-Object System.Drawing.Drawing2D.PathGradientBrush($sparkPath)
try {
$sparkBrush.CenterColor = New-Color -A 190 -R 255 -G 255 -B 255
$sparkBrush.SurroundColors = @((New-Color -A 0 -R 255 -G 255 -B 255))
$graphics.FillPath($sparkBrush, $sparkPath)
}
finally {
$sparkBrush.Dispose()
}
}
finally {
$sparkPath.Dispose()
}
Draw-Line -Graphics $graphics -Color (New-Color -A 86 -R 255 -G 255 -B 255) -Width 10.0 -X1 708.0 -Y1 216.0 -X2 708.0 -Y2 282.0
Draw-Line -Graphics $graphics -Color (New-Color -A 86 -R 255 -G 255 -B 255) -Width 10.0 -X1 675.0 -Y1 249.0 -X2 741.0 -Y2 249.0
$bitmap.Save($previewPath, [System.Drawing.Imaging.ImageFormat]::Png)
Save-MultiSizeIcon -MasterBitmap $bitmap -OutputPath $iconPath -Sizes @(16, 24, 32, 48, 64, 128, 256)
}
finally {
$graphics.Dispose()
}
}
finally {
$bitmap.Dispose()
}
Write-Host "Generated:"
Write-Host " $previewPath"
Write-Host " $iconPath"