1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="800"
x:Class="UVtools.WPF.Controls.Tools.ToolMaskControl">
<StackPanel Spacing="10">
<StackPanel Orientation="Horizontal" Spacing="10">
<Button
Padding="10"
Content="Import grayscale mask image from file"
Command="{Binding ImportImageMask}"
/>
<CheckBox
VerticalAlignment="Center"
IsChecked="{Binding IsMaskInverted}"
Content="Invert Mask"/>
</StackPanel>
<Border
BorderBrush="LightGray"
BorderThickness="1"
Margin="0,5"
Padding="5"
>
<StackPanel>
<TextBlock FontWeight="Bold" Text="Mask generator (Round from center):"/>
<Grid
RowDefinitions="Auto,10,Auto"
ColumnDefinitions="Auto,10,Auto,10,Auto,10,Auto,10,Auto"
Margin="0,10,0,0"
>
<TextBlock
VerticalAlignment="Center"
Text="Minimum brightness:"/>
<NumericUpDown
Grid.Row="0"
Grid.Column="2"
Minimum="0"
Maximum="255"
Value="{Binding GenMinimumBrightness}"
/>
<TextBlock
Grid.Row="0"
Grid.Column="4"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="(0-255)"/>
<TextBlock
Grid.Row="0"
Grid.Column="6"
VerticalAlignment="Center"
Text="Maximum brightness:"
/>
<NumericUpDown
Grid.Row="0"
Grid.Column="8"
Minimum="0"
Maximum="255"
Value="{Binding GenMaximumBrightness}"
/>
<TextBlock
Grid.Row="2"
VerticalAlignment="Center"
Text="Diameter in pixels:"/>
<NumericUpDown
Grid.Row="2"
Grid.Column="2"
Minimum="0"
Maximum="10000"
Value="{Binding GenDiameter}"
/>
<Button
Grid.Row="2"
Grid.Column="4"
Grid.ColumnSpan="5"
Content="Generate"
Padding="5"
VerticalAlignment="Stretch"
Command="{Binding GenerateMask}"
/>
</Grid>
</StackPanel>
</Border>
<TextBlock Text="{Binding InfoPrinterResolutionStr}"/>
<TextBlock Text="{Binding InfoMaskResolutionStr}"/>
<Border
BorderBrush="LightGray"
BorderThickness="1"
Margin="0,5"
Padding="5"
>
<StackPanel Height="400">
<TextBlock FontWeight="Bold" Text="Mask image:"/>
<Image
Height="300"
Width="450"
Stretch="UniformToFill"
Source="{Binding MaskImage}"/>
</StackPanel>
</Border>
</StackPanel>
</UserControl>
|