NSDrawNinePartImage alternative using CoreGraphics