Trying to figure out how to do my own 9-slicing

I had tried doing the same thing in the canvas, and doing it by manipulating a sizebox and i got different results. Trying again and now it works similarly. idk, maybe i did something wrong before.

Ill need to mess around with stuff a lot more.