-3

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];
}

別の@implementationと@interfaceを追加せずに、NSViewのサブクラス内にあること。これはクリッピングを実現するためです。または、クリッピングのための他のオプションはありますか?「NSBezierPathのドロークリップ」と言ったら、自分自身を説明する必要があります。

4

1 に答える 1

1
[NSBezierPath clipRect:myClipRect];
于 2011-05-19T14:07:05.630 に答える