Giter Site home page Giter Site logo

avalonia.svg's Introduction



License

This library is distributed under the MIT license.

About

๐Ÿ““ Avalonia.Svg is a .net rendering engine for loading and displaying Scalable Vector Graphics (SVG) files in Avalonia applications. It provides a simple way to load and render SVG files as part of your UI.

๐ŸŽ“ Avalonia is a cross-platform .net UI framework.

๐Ÿ“… This library could be also available in WPF in future, not now.

๐Ÿ”” Objects generated by this rendering engine are static and non-editable.

๐Ÿ˜ข My English is not very well. Please forgive me if there are any mistakes in my expression.

โค๏ธ Any suggestions and comments are appreciated. If you find a bug or would like to contribute to this library, please open an issue or submit a pull request on GitHub.

Using

  • About nuget: Not available now.

  • Using Icon control and it's IconSvg Property.

<controls:Icon Width="24"
               Height="24"
               IconSvg="avares://Nlnet.Avalonia.Svg.Sample/Assets/bug-fill.svg" />
  • Using Icon control and it's IconSvgData Property.
<controls:Icon ClipToBounds="{Binding #ClipToBounds.IsChecked}"
               IconStretch="Uniform"
               IconSvg="avares://Nlnet.Avalonia.Svg.Sample/Assets/NLNet.svg"
               IconSvgData="{Binding Path=EditableSvgData}"
               IsHitTestVisible="False"
               Opacity="{Binding #SvgGroundOpacity.Value}"
               ShowDiagnosis="{Binding #ShowDiagnosis.IsChecked}" />

SVG Viewer using it.

image-20230324012006442

image-20230324012210119

image-20230324012210119

image-20230324012210119

image-20230324012210119

Features

โœ… The Avalonia.Svg library supports a variety of features for loading and rendering SVG files, including:

  • Loading SVG files from a svg data, svg file or a stream.
  • Resolving external resources (such as images) referenced in the SVG file.
  • Applying transformations (such as scaling, rotation, and translation) to the SVG image.
  • Setting the fill and stroke colors of the SVG image.
  • Clipping the SVG image to a specific area.

๐Ÿ˜” While the Avalonia.Svg library supports a wide range of SVG features, there are some limitations to be aware of:

  • The library does not support all SVG elements and attributes. In particular, some advanced features (such as filters and masks) are not currently supported.

  • Animation and some other external feature of SVG are not supported, like resolving external resources (such as images) referenced in the SVG file.

  • Performance may be impacted when rendering complex SVG files with a large number of elements or gradients. We have not made any performance optimization about it till now.

๐Ÿ“… Pattern, masker and mark are coming soon.

Document Structure

Tag Support
svg โœ”๏ธ
g โœ”๏ธ
defs โœ”๏ธ
symbol โŒ
use โœ”๏ธ
switch โŒ
desc, title ๐Ÿ“…
matadata ๐Ÿ“…

โœ”๏ธ Styling

We have implemented the CSS style system for SVG. We support explicit style, implicit style with selectors and local setter to set property.

โœ”๏ธ Geometry Properties

We support all geometry properties include cx, ry, r, rx, ry, x, y, width, height.

โœ”๏ธ Coordinate Systems, Transformations and Units

We support viewBox, transform and preserveAspectRatio properties. Note that the viewBox and preserveAspectRatio is only available in svg tag now.

โœ”๏ธ Paths

Support it.

โœ”๏ธ Basic Shapes

We support all basic shapes include rect, circle, ellipse, line, polyline, poligon.

๐Ÿ“… Text

Not yet.

โŒ Embedded Content

Not yet and no plan about it.

โœ”๏ธ Painting: Filling, Stroking and Marker Symbols

We have supported fill, stroke. ๐Ÿ“… Marker is not supported yet.

โœ”๏ธ Paint Servers: Gradients and Patterns

We have supported gradients. ๐Ÿ“… Patterns not yet.

โŒ Scripting and Interactivity

Not yet and no plan about it.

โŒ Linking

Not yet and no plan about it.

Release Plan

The version 1.0.0 would come after the use and pattern being done. And then we will make a nuget package for developers.

Q&A

None.

avalonia.svg's People

Contributors

liwuqingxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

aboimpinto

avalonia.svg's Issues

missing file?

hi!

I cloned your project, and I noticed the sample contains a path which is... on your local harddisk.
D:\SVGLogos.db

I looked around in your github project - and maybe I am a blind bat who doesn't find his own socks in the drawer ;-) -
but I can't seem to find the file.

Would you mind sharing it? Or maybe even change the path to a file that's included in the project,
so that it works without crashing.

Thanks!
Loki

[BUG] missing RenderWithMaskElementGroup

Describe the bug
I cloned the project into my Ubuntu and tried to compile and the result was an error because could not find RenderWithMaskElementGroup in the context.

To Reproduce

Expected behavior
Well ... be able to compile it

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.