Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从我的应用程序中标记一些打开的窗口。我可以获得窗口列表、它们的系统 ID、名称、所有者……我可以只在选择的窗口上绘制一些 NSImage 吗?
如果您有一个窗口,正如您所说的那样,您可以添加一个NSImageView作为该窗口的子视图。这NSImageView应该设置为具有与相关窗口相同大小的框架,以便填充窗口。
NSImageView
如果您需要进行自定义绘图,您可以继承NSImageView并覆盖其drawRect:方法,或者您可以将其图像属性设置为您已经创建并添加到应用程序包中的图像。
drawRect:
希望这就是你的意思。