The SVG image height and width properties are doubles… but how to map those to pixels fro screen display… Are they points? The docs don’t state that. And looking at:
So it looks like Pixels in SVG assumes Windows 96 dpi…
Basically seems like it could depend on how the SVGs are configured internally…
Why I am asking is that I want to create Xojo pictures with the appropriate resolution for the screen (retina vs non, or different MS Windows scaling the user can set).
In other words to create the bitmap the gets converted to a Xojo picture cached for the paint event, should I do: DIM bitmap As RawBitmap = m_svg.ToRawBitmap(m_svg.width * Window.Scalefactor, m_svg.height * window.scalefactor)
if the length units are in points that would be right but teh calculation would be different if bases on 96 dpi…
I may be totally off base here… this kine of thing confuses me as I am not good with graphics!
<?xml version="1.0" standalone="yes"?>
<parent xmlns="http://some.url">
<!-- SVG graphic -->
<svg xmlns='http://www.w3.org/2000/svg'
width="100px" height="200px">
<path d="M100,100 Q200,400,300,100"/>
<!-- rest of SVG graphic would go here -->
</svg>
</parent>
This one would be in pixels…
The library we got under the hood does not specify as far as I know. So I guess some testing would be needed here. Like testing what you would get on image like the one above. Add if having some other kinds that maybe define cm instead of pixel.
So if I understand it correctly the SVG can have quite a bit of different as listed here:
Ideally the plugin would take whatever units are defined in the SVG and convert what is reported to us in either points or pixels to be consistent so we can always draw a properly scaled bitmap when needed…
But it sounds like that is not the case and it will be SVG file dependent, which is unfortunate.