ElinamLLC / SharpVectors

SharpVectors - SVG# Reloaded: SVG DOM and Rendering in C# for the .Net.
https://elinamllc.github.io/SharpVectors/
BSD 3-Clause "New" or "Revised" License
713 stars 136 forks source link

Ignore the use of external resources #229 #230

Closed mb-jp closed 1 year ago

mb-jp commented 1 year ago

In addition to fixing #229, this pull request also adds a property to block uses of bitmaps to WpfDrawingSettings.CanUseBitmap

paulushub commented 1 year ago

Great, but what is the difference between the two properties?

mb-jp commented 1 year ago

WpfDrawingSettings.AccessExternalResourcesMode can have three values (Allow, Ignore and ThrowError).

WpfDrawingSettings.CanUseBitmap is a bool with the default value true, which stops the use of bitmaps in image elements.

paulushub commented 1 year ago

WpfDrawingSettings.CanUseBitmap is a bool with the default value true, which stops the use of bitmaps in image elements.

If you are allowing use of external resources, what is the value of this property? I see the need for AccessExternalResourcesMode as security support, but cannot see the role of CanUseBitmap.

mb-jp commented 1 year ago

CanUseBitmap should be in a separate pull request, i can remove it and open a new issues for it.

paulushub commented 1 year ago

CanUseBitmap should be in a separate pull request, i can remove it and open a new issues for it.

Sorry, I could not explain this well. When is the use of this property necessary? or why do we need it?

mb-jp commented 1 year ago

It is for another use case, not directly connected to #230.

I have a use case where I want to stop the user from using bitmaps in SVG files in the program, the SVG must look good when scaled up or down, so CanUseBitmap just stop image elements from rendering images.

paulushub commented 1 year ago

@mb-jp Sorry, please can you add Xml Docs?