Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Margins are removed while display the image #213

Closed
eladpotok opened this issue Oct 20, 2021 · 1 comment
Closed

Margins are removed while display the image #213

eladpotok opened this issue Oct 20, 2021 · 1 comment

Comments

@eladpotok
Copy link

Lets take a look on this svg url: https://www.svgrepo.com/show/254105/batman.svg .

Using as web component supports the margin. for example, this image with 250px in web looks like that:
image

But when using this library, the image is stretched and covers the whole 250px:
image

thanks

@paulushub
Copy link
Contributor

@eladpotok The WPF renderers in SharpVectors do not restrict the size of the converted image, since it is a conversion from a vector to vector format. This is done so that the containers like the Image can have full control over the stretching, sizing and positioning of the output image (including paddings and margins). So, it will stretch to any width you specify in the Image object and by the stretching options you specify.

If you wish to restrict the size, use the controls like SvgViewbox or SvgCanvas and set the option WpfDrawingSettings.EnsureViewboxSize to true. This will output a transparent boundary around the rendered image, with the size defined by the viewbox and in the above case 0 0 512 512.

@ElinamLLC ElinamLLC locked and limited conversation to collaborators Oct 22, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants