Skip to content

Commit 997d8d8

Browse files
authored
Merge pull request #74 from paulushub/master
Refactoring, code improvements and bug fixes
2 parents f5e41f4 + ab8b1f0 commit 997d8d8

File tree

160 files changed

+3977
-26423
lines changed

Some content is hidden

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

160 files changed

+3977
-26423
lines changed

.github/workflows/gh-pages.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Your GitHub workflow file under .github/workflows/
2+
name: DocFX
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
publish-docs:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Dotnet Setup
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: 7.x
19+
20+
- run: dotnet tool update -g docfx
21+
- run: docfx Docs/docfx.json
22+
23+
- name: Upload DocFX packages
24+
uses: actions/upload-artifact@v3
25+
with:
26+
name: docfx_site
27+
path: ${{ github.workspace }}/Docs/_site
28+
29+
- name: Deploy
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: Docs/_site

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: 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+
## Documentations
12+
For the User Manual and API References see [Documentation](http://dotnetprojects.github.io/SVGImage/).
13+
14+
## Framework support
15+
The SVGImage control library targets the following frameworks
16+
* .NET Framework, Version 4.0
17+
* .NET Framework, Version 4.5
18+
* .NET Framework, Version 4.6
19+
* .NET Framework, Version 4.7
20+
* .NET Framework, Version 4.8
21+
* .NET Core, Version 3.1
22+
* .NET 6 ~ 7
23+
24+
## License
25+
The SVGImage control library is relicensed under [MIT License](https://github.com/dotnetprojects/SVGImage/blob/master/LICENSE),
26+
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/license.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) `2020-2023` `PropertyTools and DotNetProjects contributors`
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a
7+
copy of this software and associated documentation files (the
8+
"Software"), to deal in the Software without restriction, including
9+
without limitation the rights to use, copy, modify, merge, publish,
10+
distribute, sublicense, and/or sell copies of the Software, and to
11+
permit persons to whom the Software is furnished to do so, subject to
12+
the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included
15+
in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Docs/articles/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Introduction
2+
href: intro.md
3+
- name: License
4+
href: license.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; 2020 - 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

0 commit comments

Comments
 (0)