Join GitHub today
SvgImage: allow 9-slice SVG rendering #23
[Spun off from a issue on NGraphics.]
Potential implementation: https://github.com/twintechs/NControl.Controls.SvgImageView
The goal is to allow functionality similar to 9-patch Android image assets and StretchableImage/CreateResizableImage. Someone consuming the control would set inset values that would dictate corner areas that are preserved while stretching content to render in all the remaining areas.
I've created a control that makes this work (originally based on a different NGraphics-derived SvgImage, but now available in the above NControl-based solution. For more details, check out this blog post describing my [9-slice SVG approach](For more details, check out this blog post describing my 9-slice SVG approach.).
Unfortunately, since this naive 9-slice implementation requires drawing a series of canvases into the final desired canvas, it needs access to the ability to create a platform canvas. (That is why I had to create the custom renderers.) I wasn't sure how to make that work within the NControl system. It looks like NGraphics' next release will offer a
Great! I'll see if it possible for NControl to expose this functionality.