Set x/y position for SVG draw
See original GitHub issueDescription
The SVG graphic is always positioned at point 0, 0. The transfer of the values is ignored when drawing. The assigned values (e.g. x = 25; y = 125) are not transferred to the SVG object.
In version 3.0.102 the values were taken over correctly and the SVG graphics were positioned. In this version Integer values could be used directly. The conversion to Single and then to SvgUnit was an attempt to adapt it to the new version. Unfortunately, this failed.
Example data
Dim recoloredSVG As SvgDocument = SvgDocument.Open(DocSVG.BaseUri.LocalPath)
Dim x As Integer = 25
Dim y as Integer = 125
Dim x As Single = Convert.ToSingle(x_icon)
Dim y As Single = Convert.ToSingle(y_icon)
Dim svg_x As SvgUnit = New SvgUnit(SvgUnitType.Pixel, x)
Dim svg_y As SvgUnit = New SvgUnit(SvgUnitType.Pixel, y)
With recoloredSVG
.Width = w_icon
.Height = h_icon
.X = svg_x
.Y = svg_y
.Draw(e.Graphics)
End With
Used Versions
Nuget Version 3.3.0 .NET Framework 4.8 OS Win 10 21H1 (Build 19043.1288)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Set X and Y value for g element of SVG
I am relatively new in SVG drawing with HTML5. What I want to do is to make a group of elements in SVG...
Read more >Positions - SVG: Scalable Vector Graphics - MDN Web Docs
In this article, we examine how Scalable Vector Graphics (SVG) represents the positions and sizes of objects within a drawing context, ...
Read more >Coordinate Systems, Transformations and Units — SVG 2
Every SVG viewport defines a drawing region characterized by a size (width, height), and an origin ... set the larger of scale-x and...
Read more >SVG Coordinate Systems and Units - SVG Viewport and ...
Let's examine how SVG represents the positions and sizes of objects for drawing. The default coordinate system in SVG is much the same...
Read more >Mimic Relative Positioning Inside an SVG with Nested SVGs
Every element in SVG is positioned "absolutely" relative to the SVG viewport, and the position inside the viewport is governed by the current ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Took a little longer but I can confirm that it works.
Tried the workaround using TranslateTransform, seems to work 😃
My approach …
` Dim vektorgrafik As Svg.SvgDocument = design.gfx.vector.wagen.byKey(name)