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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
<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="450"
x:Class="UVtools.WPF.Controls.Tools.ToolLayerImportControl">
<StackPanel Spacing="10">
<Grid RowDefinitions="Auto,10,Auto,10,Auto,10,Auto"
ColumnDefinitions="Auto,10,150,5,Auto,20,Auto">
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
ToolTip.Tip="Insert: Insert layers. (Requires images with bounds equal or less than file resolution)

Replace: Replace layers. (Requires images with bounds equal or less than file resolution)

Stack: Stack layers content. (Requires images with bounds equal or less than file resolution)

Merge: Merge/Sum layers content. (Requires images with same resolution)

Subtract: Subtract layers content. (Requires images with same resolution)

BitwiseAnd: Perform a 'bitwise and' operation over layer pixels. (Requires images with same resolution)

BitwiseOr: Perform a 'bitwise or' operation over layer pixels. (Requires images with same resolution)

BitwiseXOr: Perform a 'bitwise xor' operation over layer pixels. (Requires images with same resolution)"
Text="Import type:"/>
<ComboBox Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
SelectedItem="{Binding Operation.ImportType}"
Items="{Binding Operation.ImportTypesItems}"/>
<TextBlock Grid.Row="0" Grid.Column="4"
VerticalAlignment="Center"
Text="layers"/>
<CheckBox Grid.Row="0" Grid.Column="6"
IsChecked="{Binding Operation.ExtendBeyondLayerCount}"
IsVisible="{Binding Operation.IsExtendBeyondLayerCountVisible}"
ToolTip.Tip="If enabled, imported images that go beyond last layer are appended. The file will grow in layer count if necessary to fit all imported layers.

If disabled, all imported images that go beyond last layer are discarded. The file will maintain same layer count."
Content="Extend beyond layer count"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
Text="Start at layer:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Minimum="0"
Maximum="{Binding MaximumLayer}"
Value="{Binding Operation.StartLayerIndex}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
VerticalAlignment="Center"
Text="{Binding InfoLayerHeightStr}"/>
<CheckBox Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="5"
IsChecked="{Binding Operation.DiscardUnmodifiedLayers}"
ToolTip.Tip="If enabled, all unmodified layers forward the last inserted layer are discarded.

If disabled, the unmodified layers are kept."
Content="Discard unmodified layers"/>
<TextBlock Grid.Row="6" Grid.Column="0"
VerticalAlignment="Center"
IsVisible="{Binding Operation.IsImportStackType}"
Text="Stack margin:"/>
<NumericUpDown Grid.Row="6" Grid.Column="2"
IsVisible="{Binding Operation.IsImportStackType}"
Minimum="0"
Maximum="65535"
Value="{Binding Operation.StackMargin}"/>
<TextBlock Grid.Row="6" Grid.Column="4"
VerticalAlignment="Center"
IsVisible="{Binding Operation.IsImportStackType}"
Text="px"/>
</Grid>
<CheckBox
IsChecked="{Binding IsAutoSortLayersByFileNameChecked}"
Content="Auto sort files by filename"/>
<TextBlock Text="{Binding InfoImportResult}" />
<Border BorderBrush="Gray" BorderThickness="1" Padding="5">
<Grid>
<StackPanel Spacing="5" Orientation="Horizontal">
<Button Padding="5" Command="{Binding AddFiles}">
<StackPanel Spacing="5" Orientation="Horizontal">
<TextBlock Text="Add"/>
<Image Source="/Assets/Icons/plus-16x16.png"/>
</StackPanel>
</Button>
<Button
Padding="5"
IsEnabled="{Binding #FilesListBox.SelectedItems.Count}"
Command="{Binding RemoveFiles}">
<StackPanel Spacing="5" Orientation="Horizontal">
<TextBlock Text="Remove"/>
<Image Source="/Assets/Icons/minus-16x16.png"/>
</StackPanel>
</Button>
</StackPanel>
<StackPanel
HorizontalAlignment="Right"
Spacing="5" Orientation="Horizontal">
<Button Padding="5"
IsEnabled="{Binding Operation.Files.Count}"
Command="{Binding Operation.Sort}">
<StackPanel Spacing="5" Orientation="Horizontal">
<TextBlock Text="Sort by file name"/>
<Image Source="/Assets/Icons/sort-alpha-up-16x16.png"/>
</StackPanel>
</Button>
<Button
IsEnabled="{Binding Operation.Files.Count}"
Padding="5" Command="{Binding ClearFiles}">
<StackPanel Spacing="5" Orientation="Horizontal">
<TextBlock Text="Clear"/>
<Image Source="/Assets/Icons/delete-16x16.png"/>
</StackPanel>
</Button>
<TextBlock
VerticalAlignment="Center"
Text="{Binding Operation.Files.Count, StringFormat=Files: \{0\}}"/>
</StackPanel>
</Grid>
</Border>
<Grid
ColumnDefinitions="400,400"
RowDefinitions="400"
>
<ListBox
Name="FilesListBox"
SelectionMode="Multiple"
SelectedItem="{Binding SelectedFile}"
Items="{Binding Operation.Files}" />
<Image
Grid.Column="1"
Stretch="Uniform"
Source="{Binding PreviewImage}"/>
</Grid>
</StackPanel>
</UserControl>
|