moin,
ich habe eine zeichenfläche gemacht (abgeleitet von NSView) mit drawRect funktion. Funzt soweit aber wenn ich jetzt ein Polygon (NSBezierPath) erstellt habe - wie bekomme ich dieses nun auf meine Zeichenfläche. Hab das zugrundeliegende System glaube falsch verstanden...
mfg
d
Alles anzeigen
ich habe eine zeichenfläche gemacht (abgeleitet von NSView) mit drawRect funktion. Funzt soweit aber wenn ich jetzt ein Polygon (NSBezierPath) erstellt habe - wie bekomme ich dieses nun auf meine Zeichenfläche. Hab das zugrundeliegende System glaube falsch verstanden...
mfg
d
Quellcode
- - (void)drawRect:(NSRect)rect
- {
- NSBezierPath *theGround = [NSBezierPath bezierPathWithRect:rect];
- NSColor *theBGColor = [NSColor colorWithDeviceRed:(float)0.4 green:(float)0.8 blue:(float)0.1 alpha:(float)1.0];
- [theBGColor set];
- [theGround fill];
- theBGColor = [NSColor colorWithDeviceRed:(float)0.3 green:(float)0.3 blue:(float)0.0 alpha:(float)1.0];
- [theBGColor set];
- [theGround setLineWidth:4.];
- [theGround stroke];
- }
