|
14 | 14 | <KeyBinding Command="ApplicationCommands.Undo" Gesture="Ctrl+Z"/>
|
15 | 15 | </Window.InputBindings>
|
16 | 16 |
|
| 17 | + <Window.Resources> |
| 18 | + |
| 19 | + <!-- Change this to any pure hue i.e. no more than 2 rgb components set and at least 1 set to FF --> |
| 20 | + <Color x:Key="CurrentColor">#00FF00</Color> |
| 21 | + |
| 22 | + <LinearGradientBrush x:Key="HueBrush" StartPoint="0,0" EndPoint="0,1"> |
| 23 | + <LinearGradientBrush.GradientStops> |
| 24 | + <GradientStop Color="#FF0000" Offset="0" /> |
| 25 | + <GradientStop Color="#FFFF00" Offset="0.167" /> |
| 26 | + <GradientStop Color="#00FF00" Offset="0.333" /> |
| 27 | + <GradientStop Color="#00FFFF" Offset="0.5" /> |
| 28 | + <GradientStop Color="#0000FF" Offset="0.667" /> |
| 29 | + <GradientStop Color="#FF00FF" Offset="0.833" /> |
| 30 | + <GradientStop Color="#FF0000" Offset="1" /> |
| 31 | + </LinearGradientBrush.GradientStops> |
| 32 | + </LinearGradientBrush> |
| 33 | + |
| 34 | + <VisualBrush x:Key="LevelSaturationBrush" TileMode="None"> |
| 35 | + <VisualBrush.Visual> |
| 36 | + <Canvas Background="Black" Width="1" Height="1" SnapsToDevicePixels="True"> |
| 37 | + <Rectangle Width="1" Height="1" SnapsToDevicePixels="True"> |
| 38 | + <Rectangle.Fill> |
| 39 | + <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> |
| 40 | + <LinearGradientBrush.GradientStops> |
| 41 | + <GradientStop Color="White" Offset="0" /> |
| 42 | + <GradientStop Color="{DynamicResource CurrentColor}" Offset="1" /> |
| 43 | + </LinearGradientBrush.GradientStops> |
| 44 | + </LinearGradientBrush> |
| 45 | + </Rectangle.Fill> |
| 46 | + <Rectangle.OpacityMask> |
| 47 | + <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> |
| 48 | + <LinearGradientBrush.GradientStops> |
| 49 | + <GradientStop Color="#FFFFFFFF" Offset="0"/> |
| 50 | + <GradientStop Color="#00FFFFFF" Offset="1"/> |
| 51 | + </LinearGradientBrush.GradientStops> |
| 52 | + </LinearGradientBrush> |
| 53 | + </Rectangle.OpacityMask> |
| 54 | + </Rectangle> |
| 55 | + </Canvas> |
| 56 | + </VisualBrush.Visual> |
| 57 | + </VisualBrush> |
| 58 | + |
| 59 | + </Window.Resources> |
| 60 | + |
17 | 61 | <Grid>
|
18 | 62 | <Grid.Resources>
|
19 | 63 | <local:EnumBooleanConverter x:Key="ComparisonConverter" />
|
20 | 64 | </Grid.Resources>
|
21 | 65 |
|
22 |
| - <ToolBarTray Background="White" Height="36" VerticalAlignment="Top"> |
| 66 | + <ToolBarTray Background="White" Height="32" VerticalAlignment="Top"> |
23 | 67 | <ToolBar Band="1" BandIndex="1" VerticalAlignment="Top">
|
24 | 68 | <Button x:Name="btnNew" ToolTip="New (clear image)" Click="OnClearButton">
|
25 | 69 | <Image Source="/Resources/Buttons/emptybutton.png" />
|
|
32 | 76 | <ToolBar Band="1" BandIndex="1" VerticalAlignment="Top">
|
33 | 77 | <RadioButton GroupName="Toolbar" Tag="Draw" ToolTip="Pencil" Style="{StaticResource {x:Type ToggleButton}}"
|
34 | 78 | IsChecked="{Binding Path=CurrentTool, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static local:ToolMode.Draw},Mode=TwoWay}">
|
35 |
| - <Image Source="/Resources/Buttons/drawmode.png" /> |
| 79 | + <Image Source="/Resources/Buttons/drawmode.png" Width="24" Height="24" RenderOptions.BitmapScalingMode="NearestNeighbor" /> |
36 | 80 | </RadioButton>
|
37 | 81 | <RadioButton GroupName="Toolbar" Tag="Fill" ToolTip="Flood Fill" Style="{StaticResource {x:Type ToggleButton}}"
|
38 | 82 | IsChecked="{Binding Path=CurrentTool, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static local:ToolMode.Fill},Mode=TwoWay}">
|
39 |
| - <Image Source="/Resources/Buttons/emptybutton.png" /> |
| 83 | + <Image Source="/Resources/Buttons/emptybutton.png" RenderOptions.BitmapScalingMode="NearestNeighbor" /> |
40 | 84 | </RadioButton>
|
41 | 85 | </ToolBar>
|
42 | 86 |
|
|
103 | 147 | <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,50,0,0" VerticalAlignment="Top" Width="16">
|
104 | 148 | <Image x:Name="imgPreview1x" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill"/>
|
105 | 149 | </Border>
|
| 150 | + <Rectangle x:Name="recPreviewBg2xb" Fill="Gray" HorizontalAlignment="Left" Height="32" Margin="375,100,0,0" VerticalAlignment="Top" Width="32"/> |
| 151 | + <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="32" Margin="375,100,0,0" VerticalAlignment="Top" Width="32"> |
| 152 | + <Image x:Name="imgPreview2xb" HorizontalAlignment="Left" Height="32" Margin="-1" VerticalAlignment="Top" Width="32" Stretch="Fill"/> |
| 153 | + </Border> |
| 154 | + <Rectangle x:Name="recPreviewBg1xb" Fill="Gray" HorizontalAlignment="Left" Height="16" Margin="425,100,0,0" VerticalAlignment="Top" Width="16"/> |
| 155 | + <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,100,0,0" VerticalAlignment="Top" Width="16"> |
| 156 | + <Image x:Name="imgPreview1xb" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill"/> |
| 157 | + </Border> |
| 158 | + <Rectangle x:Name="recPreviewBg2xc" Fill="White" HorizontalAlignment="Left" Height="32" Margin="375,150,0,0" VerticalAlignment="Top" Width="32"/> |
| 159 | + <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="32" Margin="375,150,0,0" VerticalAlignment="Top" Width="32"> |
| 160 | + <Image x:Name="imgPreview2xc" HorizontalAlignment="Left" Height="32" Margin="-1" VerticalAlignment="Top" Width="32" Stretch="Fill"/> |
| 161 | + </Border> |
| 162 | + <Rectangle x:Name="recPreviewBg1xc" Fill="White" HorizontalAlignment="Left" Height="16" Margin="425,150,0,0" VerticalAlignment="Top" Width="16"/> |
| 163 | + <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,150,0,0" VerticalAlignment="Top" Width="16"> |
| 164 | + <Image x:Name="imgPreview1xc" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill"/> |
| 165 | + </Border> |
106 | 166 | <Button x:Name="btnScrollUp" Click="OnScrollButtonUpClicked" Content="/\" HorizontalAlignment="Left" Margin="388,252,0,0" VerticalAlignment="Top" Width="24"/>
|
107 | 167 | <Button x:Name="btnScrollDown" Click="OnScrollButtonDownClicked" Content="\/" HorizontalAlignment="Left" Margin="388,274,0,0" VerticalAlignment="Top" Width="24"/>
|
108 | 168 | <Button x:Name="btnScrollLeft" Click="OnScrollButtonLeftClicked" Content="<" HorizontalAlignment="Left" Margin="361,263,0,0" VerticalAlignment="Top" Width="24"/>
|
109 | 169 | <Button x:Name="btnScrollRight" Click="OnScrollButtonRightClicked" Content=">" HorizontalAlignment="Left" Margin="415,262,0,0" VerticalAlignment="Top" Width="24"/>
|
110 |
| - <Button x:Name="btnFlipX" Click="OnFlipXButtonDown" Content="FlipX" HorizontalAlignment="Left" Margin="462,251,0,0" VerticalAlignment="Top" Width="32"/> |
111 |
| - <Button x:Name="btnFlipY" Click="OnFlipYButtonDown" Content="FlipY" HorizontalAlignment="Left" Margin="462,276,0,0" VerticalAlignment="Top" Width="32"/> |
112 |
| - <Button x:Name="btnLoadPalette" Click="OnLoadPaletteButton" Content="Load Palette" HorizontalAlignment="Left" Margin="620,276,0,0" VerticalAlignment="Top" Width="77"/> |
| 170 | + <Button x:Name="btnFlipX" Click="OnFlipXButtonDown" Content="FlipX" HorizontalAlignment="Left" Margin="353,316,0,0" VerticalAlignment="Top" Width="32"/> |
| 171 | + <Button x:Name="btnFlipY" Click="OnFlipYButtonDown" Content="FlipY" HorizontalAlignment="Left" Margin="390,316,0,0" VerticalAlignment="Top" Width="32"/> |
| 172 | + <Button x:Name="btnLoadPalette" Click="OnLoadPaletteButton" Content="Load Palette" HorizontalAlignment="Left" Margin="10,321,0,0" VerticalAlignment="Top" Width="71"/> |
113 | 173 | </Grid>
|
114 | 174 | <CheckBox x:Name="chkOutline" Content="Outline" HorizontalAlignment="Left" Margin="648,50,0,0" VerticalAlignment="Top" Width="64"/>
|
115 | 175 | <Rectangle x:Name="rectCurrentColor" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="28" Margin="10,276,0,0" Stroke="Black" VerticalAlignment="Top" Width="28"/>
|
116 | 176 | <CheckBox x:Name="chkMirrorX" Content="MirrorX" HorizontalAlignment="Left" Margin="648,80,0,0" VerticalAlignment="Top" Width="64"/>
|
117 | 177 | <Rectangle x:Name="rectSecondaryColor" Fill="Black" HorizontalAlignment="Left" Height="28" Margin="47,276,0,0" Stroke="Black" VerticalAlignment="Top" Width="28"/>
|
| 178 | + |
| 179 | + <!-- https://stackoverflow.com/a/32514853/5452781 --> |
| 180 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="452,113,0,0"> |
| 181 | + <Rectangle Fill="{StaticResource LevelSaturationBrush}" Width="200" Height="200" Margin="10" Stroke="Black" StrokeThickness="1" SnapsToDevicePixels="True" /> |
| 182 | + <Rectangle Fill="{StaticResource HueBrush}" Width="20" Height="200" Margin="10" Stroke="Black" StrokeThickness="1" SnapsToDevicePixels="True" /> |
| 183 | + </StackPanel> |
| 184 | + |
118 | 185 | </Grid>
|
119 | 186 | </Window>
|
0 commit comments