Skip to content

Commit 8c2104d

Browse files
committed
Refactoring and bug fixes
- Removed the Design project - Removed the VS2017 project files - Removed .NETCore 3.0 - Removed DotnetProjects namespaces, simplified the namespaces - Removed the Attribute class, since it is the same as StyleItem class - Added DocFX projects for building documentations - Updates to the Nuget package: included Xml-docs, readme etc. - Fixed null exception in the ViewBoxToSizeNoStretch support when using Drawing sources. NOTE: The changes will results in breakings changes in the API, but there is no breaking change in Binary, and any current project using only the controls will work as usual.
1 parent f5e41f4 commit 8c2104d

File tree

96 files changed

+1621
-25518
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1621
-25518
lines changed

Docs/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
###############
2+
# folder #
3+
###############
4+
/**/DROP/
5+
/**/TEMP/
6+
/**/packages/
7+
/**/bin/
8+
/**/obj/
9+
_site

Docs/Readme.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## SVGImage
2+
This is an SVG Image View Control for WPF applications.
3+
4+
Initially forked from: [SVGImage Control - CodeProject Article](https://www.codeproject.com/Articles/92434/SVGImage-Control)
5+
6+
Besides the bug fixes, new features are added including the following:
7+
- Mask/Clip support
8+
- Support of styles.
9+
- Simple Animation support.
10+
11+
## Framework support
12+
The SVGImage control library targets the following frameworks
13+
* .NET Framework, Version 4.0
14+
* .NET Framework, Version 4.5
15+
* .NET Framework, Version 4.6
16+
* .NET Framework, Version 4.7
17+
* .NET Framework, Version 4.8
18+
* .NET Core, Version 3.1
19+
* .NET 6 ~ 7
20+
21+
## License
22+
The SVGImage control library is relicensed under [MIT License](https://github.com/dotnetprojects/SVGImage/blob/master/LICENSE),
23+
with permission from the original author.

Docs/api/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
###############
2+
# temp file #
3+
###############
4+
*.yml
5+
.manifest

Docs/api/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SVGImage API Reference
2+
3+
### [](#namespaces)Namespaces
4+
5+
#### [SVGImage.SVG](xref:SVGImage.SVG)
6+
The namespace containing the SVG controls.
7+
8+
#### [SVGImage.SVG.Animation](xref:SVGImage.SVG.Animation)
9+
The SVG animation elements namespace.
10+
11+
#### [SVGImage.SVG.FileLoaders](xref:SVGImage.SVG.FileLoaders)
12+
A namespace defining interfaces for loading external documents and resources.
13+
14+
#### [SVGImage.SVG.Filters](xref:SVGImage.SVG.Filters)
15+
A namespace defining some of the SVG filters/
16+
17+
#### [SVGImage.SVG.PaintServers](xref:SVGImage.SVG.PaintServers)
18+
The namespace defining SVG paint servers.
19+
20+
#### [SVGImage.SVG.Shapes](xref:SVGImage.SVG.Shapes)
21+
The namespace defining the geometric and related SVG shapes.

Docs/articles/intro.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Introduction
2+
3+
SVG (Scalable Vector Graphic) is an XML based graphic format.
4+
5+
This little project started out as a simple `SVG` to `XAML` converter. I looked at some simple SVG files and noticed
6+
the similarity to `XAML` defined graphic, and decided to write a converter. However, I soon realized that SVG is a
7+
very complex format, and at the same time, I found no good reason for converting to `XAML` just to show the image
8+
on the screen, so instead, I started working on the `SVG`, `SVGRender` and the `SVGImage` classes.
9+
10+
* The `SVG` class is the class that reads and parses the XML file.
11+
* `SVGRender` is the class that creates the WPF Drawing object based on the information from the SVG class.
12+
* `SVGImage` is the image control. The image control can either
13+
- load the image from a filename `SetImage(filename)`
14+
- or by setting the Drawing object through `SetImage(Drawing)`,
15+
which allows multiple controls to share the same drawing instance.
16+
17+
The control only has a couple of properties, `SizeType` and `ImageSource`.
18+
19+
* `SizeType` - controls how the image is stretched to fill the control
20+
- `None`: The image is not scaled. The image location is translated so the top left corner of the image bounding box is moved to the top left corner of the image control.
21+
- `ContentToSizeNoStretch`: The image is scaled to fit the control without any stretching. Either X or Y direction will be scaled to fill the entire width or height.
22+
- `ContentToSizeStretch`: The image will be stretched to fill the entire width and height.
23+
- `SizeToContent`: The control will be resized to fit the un-scaled image. If the image is larger than the max size for the control, the control is set to max size and the image is scaled.
24+
- `ViewBoxToSizeNoStretch`: Not the content of the image but its viewbox is scaled to fit the control without any stretching.Either `X` or `Y` direction will be scaled to fill the entire width or height.
25+
26+
For `None` and `ContentToSizeNoStretch`, the Horizontal/VerticalContentAlignment properties can be used to position the image within the control.
27+
28+
* `ImageSource` - This property is the same as `SetImage(drawing)`, and is exposed to allow for the source to be set through binding.

Docs/articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Introduction
2+
href: intro.md

Docs/docfx.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"files": [
7+
"SVGImage/DotNetProjects.SVGImage.csproj"
8+
],
9+
"src": "../Source/",
10+
"properties": {
11+
"TargetFramework": "netcoreapp3.1"
12+
}
13+
}
14+
],
15+
"dest": "api",
16+
"outputFormat": "mref",
17+
"includePrivateMembers": false,
18+
"disableGitFeatures": false,
19+
"disableDefaultFilter": false,
20+
"noRestore": false,
21+
"namespaceLayout": "flattened",
22+
"memberLayout": "samePage",
23+
"enumSortOrder": "alphabetic",
24+
"allowCompilationErrors": false
25+
}
26+
],
27+
"build": {
28+
"content": [
29+
{
30+
"files": [
31+
"api/**.yml",
32+
"api/index.md"
33+
]
34+
},
35+
{
36+
"files": [
37+
"articles/**.md",
38+
"articles/**/toc.yml",
39+
"toc.yml",
40+
"*.md"
41+
]
42+
}
43+
],
44+
"resource": [
45+
{
46+
"files": [
47+
"images/**"
48+
]
49+
}
50+
],
51+
"globalMetadata": {
52+
"_appName": "SVGImage",
53+
"_appTitle": "SVGImage Documentation",
54+
"_appLogoPath": "images/dotnetprojects.png",
55+
"_appFaviconPath": "images/dotnetprojects.png",
56+
"_enableDiagrams": true,
57+
"_enableSearch": true,
58+
"_appFooter": "<div class=\"d-flex flex-column flex-sm-row justify-content-between pt-1\"><p> &copy; 2010 - 2023 DotNetProjects</p><p>Made with <a href=\"https://dotnet.github.io/docfx\">DocFX</a></p></div>",
59+
"_gitContribute": {
60+
"repo": "https://github.com/dotnetprojects/SVGImage",
61+
"branch": "master"
62+
},
63+
"_gitUrlPattern": "github"
64+
},
65+
"output": "_site",
66+
"globalMetadataFiles": [],
67+
"fileMetadataFiles": [],
68+
"template": [
69+
"default",
70+
"modern",
71+
"template"
72+
],
73+
"postProcessors": [],
74+
"keepFileLink": false,
75+
"disableGitFeatures": false
76+
}
77+
}

Docs/images/dotnetprojects.png

3.29 KB
Loading
File renamed without changes.

Docs/index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## SVGImage
2+
This is an SVG Image View Control for WPF applications.
3+
4+
Initially forked from: [SVGImage Control - CodeProject Article](https://www.codeproject.com/Articles/92434/SVGImage-Control)
5+
6+
Besides the bug fixes, new features are added including the following:
7+
- Mask/Clip support
8+
- Support of styles.
9+
- Simple Animation support.
10+
11+
## Framework support
12+
The SVGImage control library targets the following frameworks
13+
* .NET Framework, Version 4.0
14+
* .NET Framework, Version 4.5
15+
* .NET Framework, Version 4.6
16+
* .NET Framework, Version 4.7
17+
* .NET Framework, Version 4.8
18+
* .NET Core, Version 3.1
19+
20+
## License
21+
The SVGImage control library is relicensed under [MIT License](https://github.com/dotnetprojects/SVGImage/blob/master/LICENSE),
22+
with permission from the original author.
23+
24+
## Sample Application
25+
26+
![](images/sample.png)

0 commit comments

Comments
 (0)