Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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.