|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
4 | 4 | xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
|
5 | 5 | xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
6 |
| - Title="MainWindow" |
7 |
| - Height="350" |
8 |
| - Width="525"> |
| 6 | + xmlns:simpleChildWindow="clr-namespace:MahApps.Metro.SimpleChildWindow;assembly=MahApps.Metro.SimpleChildWindow" |
| 7 | + Title="Channel Merger" |
| 8 | + Height="350" Width="600" |
| 9 | + MinHeight="350" MinWidth="530"> |
| 10 | + |
| 11 | + <Controls:MetroWindow.LeftWindowCommands> |
| 12 | + <Controls:WindowCommands> |
| 13 | + <Button> |
| 14 | + <iconPacks:PackIconMaterial Kind="Layers" /> |
| 15 | + </Button> |
| 16 | + </Controls:WindowCommands> |
| 17 | + </Controls:MetroWindow.LeftWindowCommands> |
| 18 | + |
| 19 | + <Grid> |
9 | 20 | <Grid Margin="16" Background="White">
|
10 | 21 | <Grid.Effect>
|
11 | 22 | <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="10"/>
|
|
15 | 26 | <RowDefinition Height="40"/>
|
16 | 27 | <RowDefinition Height="40"/>
|
17 | 28 | <RowDefinition Height="40"/>
|
| 29 | + <RowDefinition Height="40"/> |
18 | 30 | <RowDefinition Height="8"/>
|
19 | 31 | <RowDefinition Height="40"/>
|
20 | 32 | <RowDefinition Height="40"/>
|
|
23 | 35 | <Grid.ColumnDefinitions>
|
24 | 36 | <ColumnDefinition Width="90"/>
|
25 | 37 | <ColumnDefinition/>
|
| 38 | + <ColumnDefinition Width="84"/> |
| 39 | + <ColumnDefinition Width="40"/> |
26 | 40 | </Grid.ColumnDefinitions>
|
27 | 41 |
|
28 |
| - <Button Name="redBtn" Tag="r" Grid.Row="0" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
| 42 | + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="10">RESOLUTION</TextBlock> |
| 43 | + <ComboBox Name="ResolutionList" LostFocus="ResolutionList_OnSelected" IsEditable="True" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Margin="6" ToolTip="Select predefined resolution or enter your own"> |
| 44 | + <ComboBoxItem>64x64</ComboBoxItem> |
| 45 | + <ComboBoxItem>128x128</ComboBoxItem> |
| 46 | + <ComboBoxItem>256x256</ComboBoxItem> |
| 47 | + <ComboBoxItem>512x512</ComboBoxItem> |
| 48 | + <ComboBoxItem>1024x1024</ComboBoxItem> |
| 49 | + <ComboBoxItem IsSelected="True">2048x2048</ComboBoxItem> |
| 50 | + <ComboBoxItem>4096x4096</ComboBoxItem> |
| 51 | + <ComboBoxItem>8192x8192</ComboBoxItem> |
| 52 | + </ComboBox> |
| 53 | + |
| 54 | + <Button Name="redBtn" Tag="r" Grid.Row="1" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
29 | 55 | <Grid Margin="8,0,0,0">
|
30 | 56 | <Grid.ColumnDefinitions>
|
31 | 57 | <ColumnDefinition Width="16px"/>
|
|
36 | 62 | </Grid>
|
37 | 63 | </Button>
|
38 | 64 |
|
39 |
| - <Button Name="greenBtn" Tag="g" Grid.Row="1" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
| 65 | + <Button Name="greenBtn" Tag="g" Grid.Row="2" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
40 | 66 | <Grid Margin="8,0,0,0">
|
41 | 67 | <Grid.ColumnDefinitions>
|
42 | 68 | <ColumnDefinition Width="16px"/>
|
|
47 | 73 | </Grid>
|
48 | 74 | </Button>
|
49 | 75 |
|
50 |
| - <Button Name="blueBtn" Tag="b" Grid.Row="2" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
| 76 | + <Button Name="blueBtn" Tag="b" Grid.Row="3" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
51 | 77 | <Grid Margin="8,0,0,0">
|
52 | 78 | <Grid.ColumnDefinitions>
|
53 | 79 | <ColumnDefinition Width="16px"/>
|
|
58 | 84 | </Grid>
|
59 | 85 | </Button>
|
60 | 86 |
|
61 |
| - <Button Name="alphaBtn" Tag="a" Grid.Row="3" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
| 87 | + <Button Name="alphaBtn" Tag="a" Grid.Row="4" Grid.Column="0" Margin="4" Click="ChannelBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
62 | 88 | <Grid Margin="8,0,0,0">
|
63 | 89 | <Grid.ColumnDefinitions>
|
64 | 90 | <ColumnDefinition Width="16px"/>
|
|
69 | 95 | </Grid>
|
70 | 96 | </Button>
|
71 | 97 |
|
72 |
| - <Button Name="outBtn" Tag="a" Grid.Row="5" Grid.Column="0" Margin="4" Click="OutputBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
| 98 | + <Button Name="outBtn" Tag="a" Grid.Row="6" Grid.Column="0" Margin="4" Click="OutputBtn_Click" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"> |
73 | 99 | <Grid Margin="8,0,0,0">
|
74 | 100 | <Grid.ColumnDefinitions>
|
75 | 101 | <ColumnDefinition Width="16px"/>
|
|
80 | 106 | </Grid>
|
81 | 107 | </Button>
|
82 | 108 |
|
83 |
| - <TextBox Name="redPath" IsReadOnly="True" Grid.Row="0" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
84 |
| - <TextBox Name="greenPath" IsReadOnly="True" Grid.Row="1" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
85 |
| - <TextBox Name="bluePath" IsReadOnly="True" Grid.Row="2" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
86 |
| - <TextBox Name="alphaPath" IsReadOnly="True" Grid.Row="3" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
| 109 | + <TextBox Name="redPath" IsReadOnly="True" Grid.Row="1" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
| 110 | + <TextBox Name="greenPath" IsReadOnly="True" Grid.Row="2" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
| 111 | + <TextBox Name="bluePath" IsReadOnly="True" Grid.Row="3" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
| 112 | + <TextBox Name="alphaPath" IsReadOnly="True" Grid.Row="4" Grid.Column="1" Margin="4" VerticalContentAlignment="Center"></TextBox> |
87 | 113 |
|
88 |
| - <Grid Grid.Row="5" Grid.Column="1"> |
| 114 | + <Grid Grid.Row="6" Grid.Column="1"> |
89 | 115 | <Grid.ColumnDefinitions>
|
90 | 116 | <ColumnDefinition Width="3*"/>
|
91 | 117 | <ColumnDefinition/>
|
92 | 118 | </Grid.ColumnDefinitions>
|
93 | 119 | <TextBox Name="outputPath" IsReadOnly="True" Margin="4" VerticalContentAlignment="Center"></TextBox>
|
94 | 120 | <TextBox Name="fileName" Grid.Column="1" Margin="4" Text="result.png" VerticalContentAlignment="Center"></TextBox>
|
95 |
| - |
96 | 121 | </Grid>
|
97 | 122 |
|
98 |
| - <Button Name="mergeBtn" Grid.Row="6" Grid.Column="1" Margin="4" Click="MergeBtn_Click">Merge</Button> |
| 123 | + <ComboBox Name="RedFill" Grid.Column="2" Grid.Row="1" LostFocus="FillSelection_FocusLost" Margin="4" ToolTip="Select what colour will fill the channel if no image is selected"> |
| 124 | + <ComboBoxItem IsSelected="True">WHITE</ComboBoxItem> |
| 125 | + <ComboBoxItem>BLACK</ComboBoxItem> |
| 126 | + </ComboBox> |
| 127 | + <ComboBox Name="GreenFill" Grid.Column="2" Grid.Row="2" LostFocus="FillSelection_FocusLost" Margin="4" ToolTip="Select what colour will fill the channel if no image is selected"> |
| 128 | + <ComboBoxItem IsSelected="True">WHITE</ComboBoxItem> |
| 129 | + <ComboBoxItem>BLACK</ComboBoxItem> |
| 130 | + </ComboBox> |
| 131 | + <ComboBox Name="BlueFill" Grid.Column="2" Grid.Row="3" LostFocus="FillSelection_FocusLost" Margin="4" ToolTip="Select what colour will fill the channel if no image is selected"> |
| 132 | + <ComboBoxItem IsSelected="True">WHITE</ComboBoxItem> |
| 133 | + <ComboBoxItem>BLACK</ComboBoxItem> |
| 134 | + </ComboBox> |
| 135 | + <ComboBox Name="AlphaFill" Grid.Column="2" Grid.Row="4" LostFocus="FillSelection_FocusLost" Margin="4" ToolTip="Select what colour will fill the channel if no image is selected"> |
| 136 | + <ComboBoxItem IsSelected="True">WHITE</ComboBoxItem> |
| 137 | + <ComboBoxItem>BLACK</ComboBoxItem> |
| 138 | + </ComboBox> |
| 139 | + |
| 140 | + <Image Name="RedImage" Grid.Row="1" Grid.Column="3" Margin="4" MouseDown="Preview_Click" ToolTip="Click to preview the loaded image"></Image> |
| 141 | + <Image Name="GreenImage" Grid.Row="2" Grid.Column="3" Margin="4" MouseDown="Preview_Click" ToolTip="Click to preview the loaded image"></Image> |
| 142 | + <Image Name="BlueImage" Grid.Row="3" Grid.Column="3" Margin="4" MouseDown="Preview_Click" ToolTip="Click to preview the loaded image"></Image> |
| 143 | + <Image Name="AlphaImage" Grid.Row="4" Grid.Column="3" Margin="4" MouseDown="Preview_Click" ToolTip="Click to preview the loaded image"></Image> |
99 | 144 |
|
| 145 | + <Button Name="mergeBtn" Grid.Row="7" Grid.Column="1" Margin="4" Click="MergeBtn_Click">Merge</Button> |
| 146 | + |
| 147 | + </Grid> |
| 148 | + |
| 149 | + <simpleChildWindow:ChildWindow Name="PreviewWindow" |
| 150 | + HorizontalContentAlignment="Center" |
| 151 | + VerticalContentAlignment="Center" |
| 152 | + ShowCloseButton="True" |
| 153 | + Padding="8" |
| 154 | + IsModal="True"> |
| 155 | + <Image Name="PreviewWindowImage"></Image> |
| 156 | + </simpleChildWindow:ChildWindow> |
| 157 | + |
100 | 158 | </Grid>
|
101 | 159 | </Controls:MetroWindow>
|
0 commit comments