Comments (8)
Are you referring to Avalonia controls? If so it's not trivial task. You can style original svg via css and reload.
from svg.skia.
Oh, but i found following from the source codes:
- There s Svg control, it could be added there (lets start from simple) - two new properties: Stroke & Fill
- It need to be passed into SvgSource.LoadPicture -> SvgDocument, after SvgDocument loaded.
I understand is very limited scenario, but could you give more details how it should looks like ?
from svg.skia.
So i did exactly as i wrote above:
- Copy Svg and SvgSource to my project
- Added 2 properties: Stroke & Fill
- Load method of Svg is private so rewrite it to pass these 2 new properties to LoadPicture method of SvgSource
- in SvgSource.LoadPicture set Stroke/Fill properties of the SvgDocument
It works!
So my understanding is - it would help to add kind of array SvgProps which we will build in Svg in Load method. Then pass the SvgProps into SvgSource.LoadPicture, where it will be applied to the SvgDocument.
I'm sure there could be a better way to implement that. but at least idea is works for me!
Appreciate if you could suggest me better way, then i would be able to create PR.
See attached files for working example.
SvgStrokeAndFill.zip
PS. Realized it cause need to Reload image on every Stroke/Fill changes, would be need to may be improve that and apply changes to AvaloniaPicture.Commands. For me current solution is good enough, but yet would agree it may be need bit more thinking.
from svg.skia.
Not planning that feature currently
from svg.skia.
Related Issues (20)
- A readme submodules HOT 1
- Support for Avalonia v10.1.19 HOT 3
- Unable to convert SVG string HOT 1
- Can't render SVG from internet with Avalonia Web HOT 1
- Method 'Render' in type SvgCustomDrawOperation does not have an implementation HOT 3
- Fizzler depenency not MIT HOT 2
- Problems running the dotnet tool without .NET Core 3.1 available
- Can't display custom font when converting SVG to PDF HOT 1
- Cannot render text SVG which is one of W3C samples HOT 1
- SvgImage markupextension cannot support nested binding extension HOT 2
- SVG with some pathes are not drawn HOT 2
- Compile error after update - There is no argument given that corresponds to the required parameter 'skiaModel' of 'SKSvg.ToPicture(SvgFragment, SkiaModel, IAssetLoader)' HOT 1
- Why isn't this SVG image showing? HOT 1
- SvgExtensions.Transforms.GetDimensions rounding causes loss of precision HOT 1
- Publish a new version of Svg.Skia.Converter HOT 2
- Opacity bug HOT 1
- Vector-effect attribute is not supported HOT 1
- Strong signing the assembly HOT 2
- Colors are wrong on Quest Pro (Android + Unity) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg.skia.