可可吸噪声 [英] Cocoa draw noise
问题描述
有可能在使用NSRectFill填充的矩形顶部绘制一些噪点吗?我需要让我的应用程序绘制一个自定义标题栏看起来美妙的10.7之前发布,并使它看起来更像一个更像iTunes。我会喜欢,如果这是可能使用没有图像,但如果我必须包括一个PNG或某物作为面具,我会很好的。
Is it possible to draw some noise on top of a rect I filled using NSRectFill? I need to make my app that draws a custom title bar look wonderful on 10.7 before release, and to make it look a little more like iTunes. I would love if this is possible using no images, but if I have to include a PNG or something as a mask, I'd be fine with that.
谢谢!
推荐答案
您可以使用绘图逻辑(绘制很多小矩形,线或其他多边形),或使用NSImage的绘图方法,例如: drawInRect:fromRect:operation:fraction:
You can either use drawing logic (drawing a lot of small rects, lines or other polygons), or use NSImage's drawing methods, like for instance: drawInRect:fromRect:operation:fraction:
这篇关于可可吸噪声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!