added NinePatch from old ScaleGrid source and refactored it, rewrote DrawContext to use NinePatch