gpt4 book ai didi

cocoa-touch - NSImage 的 ressizedImageWithCapInsets ?

转载 作者:行者123 更新时间:2023-12-03 16:10:08 28 4
gpt4 key购买 nike

UIKit 中,我们有 - (UIImage *)ressizedImageWithCapInsets:(UIEdgeInsets)capInsets

AppKit 中是否有类似的东西用于创建可平铺的 NSImage

最佳答案

NSImage 在 10.10 (Yosemite) 中确实得到了轻微的改进。 NSImage 现在具有以下属性:

@property NSEdgeInsets capInsets

使用此属性,您可以像在 iOS 中一样设置上限插图。如果您调用[image drawInRect:rect],它将考虑这些插图。请注意,这仅适用于运行 10.10 或更高版本的系统;在旧系统上,它只会拉伸(stretch)图像。

关于cocoa-touch - NSImage 的 ressizedImageWithCapInsets ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14688894/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com