Skip to content

Commit f1b7527

Browse files
committed
remove borders from preview images, fix margin for canvas, add .png filter for palette load dialog
1 parent d3124f1 commit f1b7527

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

PixelArtTool/EnumsAndStructs.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public SolidColorBrush AsSolidColorBrush()
5454
return new SolidColorBrush(Color.FromArgb(Alpha, Red, Green, Blue));
5555
}
5656

57-
public PixelColor Inverted(byte alphaOverride=255)
57+
public PixelColor Inverted(byte alphaOverride = 255)
5858
{
5959
var pc = new PixelColor();
6060
pc.ColorBGRA = ColorBGRA ^ 0xffffffff;
@@ -71,7 +71,6 @@ public PixelColor Inverted(byte alphaOverride=255)
7171
{
7272
return c1.ColorBGRA != c2.ColorBGRA;
7373
}
74-
7574
} // PixelColor
7675

7776
// helper for converting bool<>enum for xaml linked values

PixelArtTool/MainWindow.xaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -172,38 +172,38 @@
172172
<Image x:Name="paletteImage" HorizontalAlignment="Left" Height="198" Margin="0,0,0,-30" VerticalAlignment="Top" Width="64" Stretch="Fill" MouseLeftButtonDown="PaletteLeftButtonDown" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
173173
</Border>
174174
<Grid>
175-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="256" Margin="89,50,0,0" VerticalAlignment="Top" Width="256">
176-
<Image x:Name="gridImage" HorizontalAlignment="Left" Height="256" Margin="-1" VerticalAlignment="Top" Width="256" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
175+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="256" Margin="89,50,0,0" VerticalAlignment="Top" Width="256">
176+
<Image x:Name="gridImage" HorizontalAlignment="Left" Height="256" VerticalAlignment="Top" Width="256" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
177177
</Border>
178-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="256" Margin="89,50,0,0" VerticalAlignment="Top" Width="256">
179-
<Image x:Name="drawingImage" HorizontalAlignment="Left" Height="256" Margin="-1" VerticalAlignment="Top" Width="256" Stretch="Fill" MouseMove="DrawingAreaMouseMoved" MouseRightButtonDown="DrawingRightButtonDown" MouseLeftButtonDown="DrawingLeftButtonDown" MouseDown="DrawingMiddleButtonDown" MouseUp="DrawingMouseUp" RenderOptions.BitmapScalingMode="NearestNeighbor" MouseLeave="drawingImage_MouseLeave" MouseEnter="drawingImage_MouseEnter"/>
178+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="256" Margin="89,50,0,0" VerticalAlignment="Top" Width="256">
179+
<Image x:Name="drawingImage" HorizontalAlignment="Left" Height="256" VerticalAlignment="Top" Width="256" Stretch="Fill" MouseMove="DrawingAreaMouseMoved" MouseRightButtonDown="DrawingRightButtonDown" MouseLeftButtonDown="DrawingLeftButtonDown" MouseDown="DrawingMiddleButtonDown" MouseUp="DrawingMouseUp" RenderOptions.BitmapScalingMode="NearestNeighbor" MouseLeave="drawingImage_MouseLeave" MouseEnter="drawingImage_MouseEnter"/>
180180
</Border>
181181
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="256" Margin="89,50,0,0" VerticalAlignment="Top" Width="256">
182-
<Image x:Name="outlineImage" IsHitTestVisible="False" HorizontalAlignment="Left" Height="256" Margin="-1" VerticalAlignment="Top" Width="256" Stretch="Fill" IsEnabled="False" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
182+
<Image x:Name="outlineImage" IsHitTestVisible="False" HorizontalAlignment="Left" Height="256" VerticalAlignment="Top" Width="256" Stretch="Fill" IsEnabled="False" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
183183
</Border>
184184
<Rectangle x:Name="recPreviewBg2x" Fill="Black" HorizontalAlignment="Left" Height="32" Margin="375,50,0,0" VerticalAlignment="Top" Width="32"/>
185-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="32" Margin="375,50,0,0" VerticalAlignment="Top" Width="32">
186-
<Image x:Name="imgPreview2x" HorizontalAlignment="Left" Height="32" Margin="-1" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
185+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="32" Margin="375,50,0,0" VerticalAlignment="Top" Width="32">
186+
<Image x:Name="imgPreview2x" HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
187187
</Border>
188188
<Rectangle x:Name="recPreviewBg1x" Fill="Black" HorizontalAlignment="Left" Height="16" Margin="425,50,0,0" VerticalAlignment="Top" Width="16"/>
189-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,50,0,0" VerticalAlignment="Top" Width="16">
190-
<Image x:Name="imgPreview1x" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
189+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="16" Margin="425,50,0,0" VerticalAlignment="Top" Width="16">
190+
<Image x:Name="imgPreview1x" HorizontalAlignment="Left" Height="16" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
191191
</Border>
192192
<Rectangle x:Name="recPreviewBg2xb" Fill="Gray" HorizontalAlignment="Left" Height="32" Margin="375,100,0,0" VerticalAlignment="Top" Width="32"/>
193-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="32" Margin="375,100,0,0" VerticalAlignment="Top" Width="32">
194-
<Image x:Name="imgPreview2xb" HorizontalAlignment="Left" Height="32" Margin="-1" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
193+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="32" Margin="375,100,0,0" VerticalAlignment="Top" Width="32">
194+
<Image x:Name="imgPreview2xb" HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
195195
</Border>
196196
<Rectangle x:Name="recPreviewBg1xb" Fill="Gray" HorizontalAlignment="Left" Height="16" Margin="425,100,0,0" VerticalAlignment="Top" Width="16"/>
197-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,100,0,0" VerticalAlignment="Top" Width="16">
198-
<Image x:Name="imgPreview1xb" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
197+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="16" Margin="425,100,0,0" VerticalAlignment="Top" Width="16">
198+
<Image x:Name="imgPreview1xb" HorizontalAlignment="Left" Height="16" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
199199
</Border>
200200
<Rectangle x:Name="recPreviewBg2xc" Fill="White" HorizontalAlignment="Left" Height="32" Margin="375,150,0,0" VerticalAlignment="Top" Width="32"/>
201-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="32" Margin="375,150,0,0" VerticalAlignment="Top" Width="32">
202-
<Image x:Name="imgPreview2xc" HorizontalAlignment="Left" Height="32" Margin="-1" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
201+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="32" Margin="375,150,0,0" VerticalAlignment="Top" Width="32">
202+
<Image x:Name="imgPreview2xc" HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="32" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
203203
</Border>
204204
<Rectangle x:Name="recPreviewBg1xc" Fill="White" HorizontalAlignment="Left" Height="16" Margin="425,150,0,0" VerticalAlignment="Top" Width="16"/>
205-
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="16" Margin="425,150,0,0" VerticalAlignment="Top" Width="16">
206-
<Image x:Name="imgPreview1xc" HorizontalAlignment="Left" Height="16" Margin="-1" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
205+
<Border BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Left" Height="16" Margin="425,150,0,0" VerticalAlignment="Top" Width="16">
206+
<Image x:Name="imgPreview1xc" HorizontalAlignment="Left" Height="16" VerticalAlignment="Top" Width="16" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
207207
</Border>
208208
<Button x:Name="btnScrollUp" Click="OnScrollButtonUpClicked" Content="/\" HorizontalAlignment="Left" Margin="388,252,0,0" VerticalAlignment="Top" Width="24"/>
209209
<Button x:Name="btnScrollDown" Click="OnScrollButtonDownClicked" Content="\/" HorizontalAlignment="Left" Margin="388,274,0,0" VerticalAlignment="Top" Width="24"/>
@@ -240,8 +240,8 @@
240240
<ImageBrush ImageSource="Resources/Images/transparentbg.png"/>
241241
</Rectangle.Fill>
242242
</Rectangle>
243-
<Rectangle x:Name="rectPixelPos" IsHitTestVisible="False" HorizontalAlignment="Left" VerticalAlignment="Top" Height="16" Stroke="Black" Width="16" Margin="90,50,0,0"/>
244-
<Button x:Name="btnSettings" Content="Settings" HorizontalAlignment="Left" Margin="675,6,0,0" VerticalAlignment="Top" Width="50" Click="btnSettings_Click"/>
243+
<Rectangle x:Name="rectPixelPos" IsHitTestVisible="False" HorizontalAlignment="Left" VerticalAlignment="Top" Height="16" Stroke="Black" Width="16" Margin="89,50,0,0"/>
244+
<Button x:Name="btnSettings" Content="Settings" HorizontalAlignment="Left" Margin="674,6,0,0" VerticalAlignment="Top" Width="50" Click="btnSettings_Click"/>
245245

246246
</Grid>
247247
</Window>

PixelArtTool/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ private void OnFlipYButtonDown(object sender, RoutedEventArgs e)
11201120
private void OnLoadPaletteButton(object sender, RoutedEventArgs e)
11211121
{
11221122
OpenFileDialog openFileDialog = new OpenFileDialog();
1123+
openFileDialog.Filter = "Palette image files (*.png) | *.png";
11231124
if (openFileDialog.ShowDialog() == true)
11241125
{
11251126
palette = LoadPalette(openFileDialog.FileName, paletteBitmap, paletteResolutionX, paletteResolutionY);

0 commit comments

Comments
 (0)