Implement 9 patch draw function