开发者

Any simple way to "resize" an NSBezierPath?

I have an NSBezierPath that I'm filling and stroking. I'd like to add some inner glow to the path (a light stroke, just inside of the outer stroke), and the thing that comes to mind is to use the same path shrunk by 1 pixel (the size of the line that is already 开发者_开发问答)stroked. Is there a way to do this?

Alternatively, is there some sort of pattern I can use when applying both a border (stroke) and a glow to a bezier path?

Example, the (extremely subtle) inner glow on the Google Chrome tabs:

Any simple way to "resize" an NSBezierPath?


You can resize a NSBezierPath quite easily using an NSAffineTransform.


You know what, you actually DON'T have to resize the bezier...all you have to do is change the stroke width:

  1. make a duplicate of the bezier
  2. on the new one, make the stroke width narrower. (So, maybe 30 on your original, try 26 on this duplicate.)

Put the new smaller one on top of the larger one.

I hope that works for you (hopefully I understood what you were getting at).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜