在类似这样的问题,一个是展示了如何使用UIKit中的
-(UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight
Run Code Online (Sandbox Code Playgroud)
轻松拉伸PNG,例如在像气泡这样的iChat中插入文本时.我想在使用CoreGraphics或一些NSImage相关API的常规AppKit/Cocoa /桌面应用程序上执行相同操作,但无法找到等效方法.有人知道如何在AppKit中执行此操作吗?