Djubiona wrote:Dear all,
Dear v1nce,
Thats the way which I use to add the image to the app:

It's XAML code. So the matter isn't really in using SVG. PNG can be converted directly to XAML.
Finally I got what I wanted by making the source image wide and low, so after transforming it looks just right.
But it would be great if someone knows the proper way. For example, it works on icons from this source:
http://modernuiicons.com/.
I've downloaded acorn and imported it in Inkscape - it really got square dotted line though acorn is small.
Any comments are appreciated. Thanks a lot!
I don't understand how you "imported" it in xaml. Did you cut/paste the content of the attribute d of the (svg) path into your LogoData ?
How do you use the LogoData ?Did you proceed the same for acorn logo ?
The path itself doesn't (explicitly) tell what the width/height should be.
It just tells : move to x,y then draw to x1,y1 ... then draw to xn, yn.
So the renderer can "guess" the surrounding border : it's x min y min, xmax y max.
With ambiguity.
Exemple :
If I want to draw a 20x40 square centered onto a 200x100 "icon" I could use
M 90,30 110,30 110,70 90,70 90,30
the rendered can guess the minimal width and height of the shape : it's xmax - xmin = 110-90 = 20 and ymax - ymin = 70-30 = 40.
but we didn't start our drawing at 0,0, we started with an offset (we started at 90,30)
So the renderer can also guess the minimal size needed to draw the shape onto a canvas.
It's xmax-0 and ymax-0 = 110 and 70.
That's all the renderer can (reasonably) guess. With this little information it can not guess we want our shape centered on a 200,100 icon.
You got to tell him explicitly.
This is why there's width and height in the svg definition of the acorn file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"
width="76" height="76" viewBox="0 0 76.00 76.00" xml:space="preserve">
(and you'll find those information in any file created with inkscape too)
So those informations are necessarily buried (in some ways) somewhere in your code.