NSBezierPath is a class responsible for constructing and drawing paths in Cocoa.
Questions tagged [nsbezierpath]
150 questions
2
votes
2 answers
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…

d11wtq
- 34,788
- 19
- 120
- 195
2
votes
1 answer
Why does this simple subclass of NSBezierPath crash my OSX Playground?
I am trying to add a stored property to an NSBezierPath by subclassing it. However the following code crashes Playground:
import Cocoa
class MyNSBezierPath: NSBezierPath {
private var someProperty: Bool
override init() {
…

Martin CR
- 1,250
- 13
- 25
2
votes
1 answer
NSBezierPath Stroke color is wrong
I want to draw a 1px wide border around my custom NSView in DrawRect with NSBezierPath:
BorderColor.Set();
var path = NSBezierPath.FromRect(theRect);
path.LineWidth = 1;
path.Stroke();
Now BorderColor is set to NSColor.Gray, which I can see while…

nvirth
- 1,599
- 1
- 13
- 21
2
votes
1 answer
Objective-C | NSBezierPath draw and color on action
I have a custom view class with a tracking area. I want that, when the mouse enters the tracking area, a bezier is drawn with a color, and when the mouse exits the area the bezier disappear. In order to make it disappear I read that the only way is…

Matteo La Mendola
- 35
- 6
2
votes
1 answer
NSString to NSBezierPath strange glyphs for some standard fonts
I'm getting glyphs of individual characters from an NSAttributedString, then get the NSBezierPath with appendBezierPathWithGlyphs:count:inFont: and finally output the flattened path points to a NSArray (see my code below) to display them with OpenGL…

Benoît Lahoz
- 1,270
- 1
- 18
- 43
2
votes
1 answer
Detect mouse over nsbezierpath
I'm a starting developer and I have this single window Mac application with a custom view inside. Inside that custom ceix I have defined multiple nsbezierpath.
Each nsbezierpath represents a region of my map so they are not rectangular at all.…

The Tom
- 2,790
- 6
- 29
- 33
2
votes
1 answer
Making a ball/circle move in cocoa using nsbezierpath(objective -c))?
I am trying to Create a point on an image when the application runs and then try to move the point slowly to a different location.
here is my code.This code works but there are two problems.
First, The processing has already happened before the…

zzzzz
- 1,209
- 2
- 18
- 45
2
votes
1 answer
Is there a way to make NSAffineTransform from CGAffineTransform?
I'm trying to convert the iOS code to OSX code, and having some difficulties with graphics porting.
Under iOS I had this:
NSRect rect = NSMakeRect(centerX.doubleValue - width.doubleValue / 2,
centerY.doubleValue -…

Eugene Gordin
- 4,047
- 3
- 47
- 80
2
votes
1 answer
how to fill an arc sector properly NSBezierPath, Objective-C
on my timer app on mac os x I want to mark the areas of my clock with green, yellow, orange and red. See screenshot below. And I want to fill the elapsed time with transparent grey.
But, as you can see at the screenshot, only the arc segment is…

Ronald Hofmann
- 1,390
- 2
- 15
- 26
2
votes
0 answers
How to make a selectable image in a NSTextView?
I am working on an application which performs some mathematical calculations and sends the results ( including texts and graphs) into a NSTextView.
This code works fine in making the output but this is the problem: I want that user can…

Aug
- 595
- 9
- 22
1
vote
2 answers
How to erase something drawn with NSBezierPath?
I have just created a path using NSBezierPath and did [path fill] to draw it onto the view. My question is how do I remove what I have drawn?
One possible solution is to use [path fill] again with the background color but this will not work if there…

hollow7
- 1,506
- 1
- 12
- 20
1
vote
1 answer
Getting any point along an NSBezier path
For a program I'm writing, I need to be able to trace a virtual line (that is not straight) that an object must travel along. I was thinking to use NSBezierPath to draw the line, but I cannot find a way to get any point along the line, which I must…

GravityScore
- 385
- 1
- 3
- 13
1
vote
1 answer
NSBezierPath point animation in NSView
I've built a custom control in Cocoa which is drawn using an NSBezierPath and I'd like it to change shape when it's state has changed (unused state = a pointed 'look here' edge, used state = standard control edge).
It feels like I've looked through…

d2kagw
- 797
- 1
- 7
- 26
1
vote
2 answers
Redraw NSBezierPath multiple times, with scaling?
I am currently writing many chunks of text on an NSView using the NSString helper method ... however it is very slow to write a large amount of in many cases repeated text. I am trying to re-write the code so that the text is converted to…

Jay
- 19,649
- 38
- 121
- 184
1
vote
1 answer
Drawing two objects in separate files
Player.m
//
// PlayerTestAppDelegate.m
// PlayerTest
//
// Created by Someguy on 5/13/11.
// Copyright 2011 Enginering. All rights reserved.
//
#import "Player.h"
@implementation Player
@synthesize window;
//[NSThread…

evdude100
- 437
- 4
- 18