可可吸噪声 [英] Cocoa draw noise

查看:173
本文介绍了可可吸噪声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能在使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆