Questions tagged [nsbezierpath]

NSBezierPath is a class responsible for constructing and drawing paths in Cocoa.

150 questions
0
votes
1 answer

using NSBezierPath how should add circular progress in mac osx

please tell me how should I add circular process using NSBezierPath . I know the method appendBezierPathWithArcWithCenter but how it works. thanks in advance
Snehal Tanawade
  • 139
  • 1
  • 9
0
votes
1 answer

NSView won't draw through bezierpath

Dear fellow Cocoa programmers, What I'd like to accomplish: I have a checkbox, a popUpButton(which is hidden) and a NSView on my canvas. If myCheckbox is checked -> show the popUpButton and draw a line through bezierPath on the NSView. if…
Verbe
  • 634
  • 7
  • 13
0
votes
1 answer

NSBezierPath on a NSView aren't lining up correctly

I have an NSWindow with a NSView (stored in a nib): I'm trying to add a BezierPath to a layer for that view (self.view2): CAShapeLayer* circleLayer = [CAShapeLayer layer]; [self.view2 setLayer:circleLayer]; circleLayer.fillColor = [NSColor…
James
  • 1,689
  • 3
  • 17
  • 21
0
votes
1 answer

Make NSBezierPath to stay relative to the NSView on windowResize

In my program I'm drawing some shapes inside an NSView using NSBezierPath. Everything works and looks great except when I resize the window. Example Initial drawing Window resize Does anyone know what I should use to prevent this square from…
Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80
0
votes
2 answers

Problems with borderless window content disappearing

If I remove this method from my view everything works fine (no content disappears if I click on a button), so this is definitely the cause. I'm trying to make a window that is rounded and has a gradient via the code below. Is there anything wrong…
user429620
0
votes
1 answer

NSView and NSBezierPath - Graph won't show- Cocoa/Objective-C

I'm trying to create an app that would simulate the trajectory of an object on free fall (more info here) with given speed and angle. The GUI is quite simple : 2 number formatted text field (for the speed and angle), 1 button to show to trajectory,…
Moray
  • 321
  • 2
  • 9
0
votes
3 answers

Should I free the C array I pass into NSBezierPath's setLineDash:count:phase: method?

I am setting the line dash style on an NSBezierPath instance: NSBezierPath *path = [NSBezierPath path]; // Get the path information... NSInteger count = 0; // Get the array count... CGFloat *dashLengths = (CGFloat *)malloc(sizeof(CGFloat) *…
d-squared
  • 107
  • 2
  • 9
0
votes
2 answers

How to add randon transparent dots over CGPath or NSBezierPath

Wanted to know how can I add transparent dots or lines over CGPath or NSBezierPath. Here are more details about the problem. I've a solid line say width = 30(drawn using NSBezierPath or CGPath) , now I wanted to draw transparent dots over it or…
Omkar
  • 1,108
  • 10
  • 19
0
votes
0 answers

NSBezierPath animation from one circle to another

I have a test view where I do some graphical test. At the the moment I have a method drawCircle which draws a colored circle with shadow. in awakeFromNib I set up a timer timerAction which triggers the method timerAction every 0.5 seconds which…
Ronald Hofmann
  • 1,390
  • 2
  • 15
  • 26
0
votes
2 answers

I wonder if angle gradient is possible

I´m doing some testing on gradients using NSBezierPath and make some progress so far with radial gradients. see first picture. I wonder, however, if it is possible to make angle gradients as in picture 2. Anyone done this? Tia, Ronald
Ronald Hofmann
  • 1,390
  • 2
  • 15
  • 26
0
votes
2 answers

Draw panel in Cocoa

I have a NSBezierPath, in the shape of a menubar panel. I'd like to make a header now. Like this one for example. But only like 30 pixels from the top. I can't figure out how I should only get the top part of the NSBezierPath. This is my first…
IluTov
  • 6,807
  • 6
  • 41
  • 103
0
votes
1 answer

Advice for image overlay

I'm looking for some advice on how to proceed. I'm working on a cocoa program (Objective-C) where I want to be able to draw over top of a bitmap image, defining areas that I can use to get information from the underlying image. As an example, I'd…
P-Rod
  • 471
  • 1
  • 5
  • 18
0
votes
1 answer

Stripped stroke on NSBezierPath

I am trying to draw a simple diagram. I have squares that are connected by lines. The lines are drawn with NSBezierPath's. I am using a random color for the lines so I can follow them. My problem is that the lines change color. The output -…
Brian
  • 3,571
  • 7
  • 44
  • 70
0
votes
1 answer

NSPoint in NSBezierPath

I was wondering if there is any way to find out if an NSPoint is inside an NSBezierPath. Like: NSPointInRect(aPoint,aRect) But with a BezierPath. Thanks in advance, Ben
BenJacob
  • 957
  • 10
  • 31
-3
votes
1 answer

drawRect in a subclass view without another implementation

I want my drawRect function, -(void)drawRect{ NSBezierPath * path = [NSBezierPath bezierPath]; [path setLineWidth:4]; NSPoint center = {ycord,xcord}; [path moveToPoint: center]; [path appendBezierPathWithArcWithCenter:center …
evdude100
  • 437
  • 4
  • 18
1 2 3
9
10