Skip to content

Commit 545f36f

Browse files
authored
Merge pull request #88 from dotnetprojects/develop
Develop
2 parents 365ed4e + 707369e commit 545f36f

21 files changed

+1392
-59
lines changed

.github/workflows/dotnetpull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: .NET
22

33
on:
44
pull_request:
5-
branches: [ master ]
5+
branches: [ master, develop ]
66

77
defaults:
88
run:

Docs/articles/intro.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ The control only has a couple of properties, `SizeType` and `ImageSource`.
2525

2626
For `None` and `ContentToSizeNoStretch`, the Horizontal/VerticalContentAlignment properties can be used to position the image within the control.
2727

28-
* `ImageSource` - This property is the same as `SetImage(drawing)`, and is exposed to allow for the source to be set through binding.
28+
* `ImageSource` - This property is the same as `SetImage(drawing)`, and is exposed to allow for the source to be set through binding.
29+
30+
The colors of an `SVGImage` can be overridden at run-time through some additional properties of the `SVGImage`:
31+
32+
* `OverrideFillColor` - This property overrides all fill colors of an SVG image
33+
* `OverrideStrokeColor` - Overrides all stroke colors of an SVG image
34+
* `OverrideColor` - Overrides all colors of an SVG image. `OverrideFillColor` and `OverrideStrokeColor` take precedence over the `OverrideColor` property.

Docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The respository includes
1515
* **Samples:** For sample applications
1616
* **Docs:** For the documentations (in markdown format).
1717

18-
The command lines installation options are: For the version `5.0.118`
19-
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.0.118
20-
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.0.118
18+
The command lines installation options are: For the version `5.1.0`
19+
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.0
20+
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.0
2121

22-
For reference in projects use: For the version `5.0.118`
22+
For reference in projects use: For the version `5.1.0`
2323
```xml
24-
<PackageReference Include="DotNetProjects.SVGImage" Version="5.0.118" />
24+
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.0" />
2525
```
2626

2727
## How to build

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
next-version: 5.0.118
1+
next-version: 5.1.0

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The respository includes
1515
* **Samples:** For sample applications
1616
* **Docs:** For the documentations (in markdown format).
1717

18-
The command lines installation options are: For the version `5.0.118`
19-
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.0.118
20-
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.0.118
18+
The command lines installation options are: For the version `5.1.0`
19+
* **.NET CLI:** dotnet add package DotNetProjects.SVGImage --version 5.1.0
20+
* **Package Manager:** NuGet\Install-Package DotNetProjects.SVGImage -Version 5.1.0
2121

22-
For reference in projects use: For the version `5.0.118`
22+
For reference in projects use: For the version `5.1.0`
2323
```xml
24-
<PackageReference Include="DotNetProjects.SVGImage" Version="5.0.118" />
24+
<PackageReference Include="DotNetProjects.SVGImage" Version="5.1.0" />
2525
```
2626

2727
## How to build

Samples/Example/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<svg1:SVGImage Source="/Example;component/Images/example radgrad01.svg" RenderTransformOrigin="0.848,0.125" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
104104
<svg1:SVGImage Source="/Example;component/Images/tiger.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
105105
<svg1:SVGImage Source="/Example;component/Images/1.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
106-
<svg1:SVGImage Source="/Example;component/Images/2.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
106+
<svg1:SVGImage Source="/Example;component/Images/2.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" OverrideFillColor="DarkGreen" OverrideStrokeColor="DarkSalmon" x:Name="OverrideSeparateColorTest" MouseDoubleClick="SVGImage_MouseDoubleClickSeparateOverride" />
107107
<svg1:SVGImage Source="/Example;component/Images/3.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
108108
<svg1:SVGImage Source="/Example;component/Images/4.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
109109
<svg1:SVGImage Source="/Example;component/Images/5.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />

Samples/Example/MainWindow.xaml.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.IO;
33
using System.IO.Compression;
44
using System.Collections.Generic;
5-
65
using System.Windows;
76

87
namespace Example
@@ -149,5 +148,24 @@ private void SVGImage_MouseDoubleClick(object sender, System.Windows.Input.Mouse
149148
rnd == 1 ? System.Windows.Media.Colors.Magenta :
150149
System.Windows.Media.Colors.Black;
151150
}
151+
152+
private void SVGImage_MouseDoubleClickSeparateOverride(object sender, System.Windows.Input.MouseButtonEventArgs e)
153+
{
154+
System.Windows.Media.Color[] colors =
155+
{
156+
System.Windows.Media.Colors.White,
157+
System.Windows.Media.Colors.Magenta,
158+
System.Windows.Media.Colors.DarkGreen,
159+
System.Windows.Media.Colors.DarkSalmon,
160+
System.Windows.Media.Colors.DarkBlue,
161+
System.Windows.Media.Colors.Black,
162+
};
163+
var ran = new Random();
164+
var rndFill = ran.Next(0, colors.Length);
165+
OverrideSeparateColorTest.OverrideFillColor = colors[rndFill];
166+
167+
var rndStroke = ran.Next(0, colors.Length);
168+
OverrideSeparateColorTest.OverrideStrokeColor = colors[rndStroke];
169+
}
152170
}
153171
}

Samples/IconConverterSample/MainWindow.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Net;
33
using System.IO;
4-
using System.Reflection;
54
using System.IO.Compression;
65
using System.Windows;
76

@@ -24,7 +23,7 @@ private void OnWindowLoaded(object sender, RoutedEventArgs e)
2423
InitializeProtocol(); //For the web access
2524

2625
// ICons credit: https://github.com/icons8/flat-color-icons
27-
string workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
26+
string workingDir = Path.GetFullPath(PageMultiple.SamplesDir);
2827

2928
string iconsPath = Path.Combine(workingDir, PageMultiple.IconZipFile);
3029
if (!File.Exists(iconsPath))

Samples/IconConverterSample/PageMultiple.xaml.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using System.Windows;
66
using System.Windows.Controls;
7+
using System.IO.Compression;
78

89
namespace IconConverterSample
910
{
@@ -43,8 +44,9 @@ public Uri ImageUri
4344
/// </summary>
4445
public partial class PageMultiple : Page
4546
{
46-
public const string IconZipFile = @"..\svg-icons.zip";
47-
public const string IconFolder = @"Svg-Icons";
47+
public const string SamplesDir = @"..\..\..\..\Tests";
48+
public const string IconZipFile = "svg-icons.zip";
49+
public const string IconFolder = "Svg-Icons";
4850

4951
public PageMultiple()
5052
{
@@ -56,15 +58,15 @@ public PageMultiple()
5658

5759
private void OnPageLoaded(object sender, RoutedEventArgs e)
5860
{
59-
string workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
61+
string workingDir = Path.GetFullPath(SamplesDir);
6062

61-
string iconsPath = Path.Combine(workingDir, PageMultiple.IconZipFile);
63+
string iconsPath = Path.Combine(workingDir, IconZipFile);
6264
if (!File.Exists(iconsPath))
6365
{
6466
return;
6567
}
6668

67-
var iconsDir = new DirectoryInfo(Path.Combine(workingDir, PageMultiple.IconFolder));
69+
var iconsDir = new DirectoryInfo(Path.Combine(workingDir, IconFolder));
6870
if (!iconsDir.Exists)
6971
{
7072
return;

Samples/IconConverterSample/PageSingle.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ namespace IconConverterSample
1111
/// </summary>
1212
public partial class PageSingle : Page
1313
{
14-
//private const string SvgFileName = @"..\Asian_Openbill.svg";
15-
private const string SvgFileName = @"..\Sf_er_nkm.svg";
14+
private const string SvgFileName = @"..\..\Resources\Hypocolius.svg";
1615

1716
public static readonly DependencyProperty LocalFileNameProperty = DependencyProperty.Register("LocalFileName",
1817
typeof(string), typeof(PageSingle), new PropertyMetadata(SvgFileName));
@@ -35,7 +34,7 @@ private void OnPageLoaded(object sender, RoutedEventArgs e)
3534
{
3635
string workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
3736

38-
string svgFilePath = Path.Combine(workingDir, SvgFileName);
37+
string svgFilePath = Path.GetFullPath(Path.Combine(workingDir, SvgFileName));
3938
if (File.Exists(svgFilePath))
4039
{
4140
inputBox.Text = svgFilePath;

0 commit comments

Comments
 (0)