在子类视图中绘制矩形,无需其他实现
我希望我的drawRect函数
-(void)drawRect{
NSBezierPath * path = [NSBezierPath bezierPath];
[path setLineWidth:4];
NSPoint center = {ycord,xcord};
[path moveToPoint: center];
[path appendBezierPathWithArcWithCenter:center
radius:plyr_size
startAngle:0
endAngle:360];
[[NSColor blackColor] set];
[path fill];
[[NSColor blackColor] set];
[path stroke];
}
位于NSView的子类中,而不添加另一个@implementation和@interface。 这是为了实现裁剪。 或者,还有其他剪辑选项吗?如果你告诉我“NSBezierPath 的drawclip”,那么你必须解释一下自己。
I want my drawRect function,
-(void)drawRect{
NSBezierPath * path = [NSBezierPath bezierPath];
[path setLineWidth:4];
NSPoint center = {ycord,xcord};
[path moveToPoint: center];
[path appendBezierPathWithArcWithCenter:center
radius:plyr_size
startAngle:0
endAngle:360];
[[NSColor blackColor] set];
[path fill];
[[NSColor blackColor] set];
[path stroke];
}
to be inside a subclass of NSView, without adding another @implementation and @interface.
This is to achieve clipping.
Alternatively, are there any other options for clipping? If you tell me "NSBezierPath's drawclip" then you have to explain yourself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)