Questions tagged [nsbezierpath]

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

150 questions
1
vote
1 answer

NSBezierPath : Stroke with 2 or 3 colors

I'm trying to recreate a menu that looks like the contextual menu of the Dock. I'm drawing a background using a NSBezierPath. As you might see, the border of the Dock's menu has 3 semi-transparent colors on the border. From the inside to the…
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
1
vote
1 answer

NSBezierPath: creating a "curved" square

I'd like to create an NSBezierPath that represents a "curved" or "bloated" square like this: I'm struggling to come up with the correct math to get this shape exactly right. I've looked all over the internet but Googling for this topic turns up…
Bryan
  • 4,628
  • 3
  • 36
  • 62
1
vote
1 answer

What is the best way to get the length of an NSBezierPath?

The path I'm using has no curves; just a series of connected points. The method I'm currently using involves iterating through the NZBezierPathElement components of the path and getting each point, but this is clumsy - especially because I have to…
chm
  • 1,519
  • 13
  • 21
1
vote
1 answer

exception with CGPathApplierFunction

my CGPathRef has 5 elements, i want to remove the starting point, and have a path with 4 elements whose beginning point is the same as the end of the path whose starting point i want to remove. this is my function now which generates an…
lulu
  • 669
  • 10
  • 26
1
vote
1 answer

Concave NSBezierPath

I have the following drawing code: [[NSColor redColor] set]; NSRect fillRect = NSMakeRect(bounds.size.width - 20.0f, 0.0f, 20.0f, 20.0f); NSBezierPath *bezier1 = [NSBezierPath bezierPathWithRoundedRect:fillRect xRadius:10.0f…
jopjip
  • 39
  • 3
1
vote
1 answer

I'm unable to position NSTextField correctly in NSBezierPath-drawn diagram

I'm a beginner Cocoa programmer. I wish to position a Cocoa NSTextField (a subview of a custom view) programmatically next to a geometric diagram drawn on the custom view in a program to be developed with XCode 4.3.2 for OS X on Lion. To keep the…
0
votes
2 answers

See if NSBezierPath(s) make a certain shape or pattern

Okay so I'm make a program where I will be universally accepting cocoa trackpad events, and I will map these events into NSBezierPaths. For example, I might have a NSBezierPath that is from just one finger, and it is circular(ish). Or the path might…
fefwfefefwfwe
  • 1,505
  • 2
  • 11
  • 19
0
votes
2 answers

NSBezierPath: how to invert the clip path?

I am drawing a rounded image in the centre of my custom view by creating a rounded NSBezierPath and adding it to the clipping region of the graphics context. This is working well, but I'm wondering if I can improve the performance of drawing the…
trojanfoe
  • 120,358
  • 21
  • 212
  • 242
0
votes
1 answer

NSTableView Rounded Corners like UITableView Groups

I'm attempting to create an NSTableView with rounded corners (much like iOS's Grouped style of table view). However, this is proving to be exceptionally difficult. I've tried to use CALayers: // ... self.wantsLayer = YES; self.layer.masksToBounds =…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
0
votes
3 answers

NSBezierPath Unique Lines

I am making a simple drawing app and am using NSBezierPath to draw the lines. I am subclassing NSView. I need to make a method which allows the user to change the color and size of the next path (so the user presses a button, then the next time they…
Alex
  • 81
  • 2
  • 11
0
votes
0 answers

Unable to draw a circle where mouse clicked

I am calling the drawMarker function from the mouseMoved function of the view by passing the CGPoints of the event.locationInWindow. The below code does not work. Appreciate any suggestions to be able to draw the markers where the mouse has moved on…
Steve
  • 25
  • 1
  • 7
0
votes
1 answer

How to achieve "application guide tutorial screen" with the focus on a particular view swift

I want to achieve the following focused UI. It is basically the guideline tutorial view for my users. The background is my main view controller with a bunch of real functional views and I put a view with 50% transparency on black on top of it to…
Tulon
  • 4,011
  • 6
  • 36
  • 56
0
votes
1 answer

CALayer shadowPath ignored on rendering as image

I am making an app that uses CAlayer to show contents like image in a NSWindow. The layer has shadows styled with shadowPath to make a better appearance. Finally to save/export the whole CAlayer and its contents the parent NSView is converted to an…
vigu
  • 21
  • 4
0
votes
1 answer

High Order Bezier Paths in Cocoa

is there any way to create Bezier Paths in Cocoa with arbitrary power? For example, for one part of my app, I need an undulating cell. So, I want to draw a curve using between 10 and 50 different points, forming a loop. The points will randomly…
0
votes
1 answer

Objective-C Drawing without drawRect: shapes won't display

I have a class called mapWindow which is hooked up to a window in IB. No matter what, the red circle which I want the program to render won't show up unless the code is under drawRect or I move the window borders. Not even unlocking and locking the…
evdude100
  • 437
  • 4
  • 18