Questions tagged [nsbezierpath]

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

150 questions
47
votes
7 answers

How can i convert NSBezierPath to CGPath

How can i convert between NSBezierPath to CGPath. Thanks.
vikas
  • 827
  • 1
  • 9
  • 19
21
votes
7 answers

How to import/parse SVG into UIBezierpaths, NSBezierpaths, CGPaths?

I am trying to import paths from a vector drawing program into the ios environment. I would like to get them into CGpaths or UIbezierpaths. I am most interested in importing paths from adobe illustrator. The best way seems to save as an svg and…
Matt
  • 1,167
  • 1
  • 15
  • 26
21
votes
3 answers

Rounded rect on NSView that clips all containing subviews

I am creating a NSView subclass that has rounded corners. This view is meant to be a container and other subviews will be added to it. I am trying to get the rounded corners of the NSView to clip all of the subview's corners as well, but am not able…
coneybeare
  • 33,113
  • 21
  • 131
  • 183
15
votes
4 answers

How to get a 1 pixel line with NSBezierPath?

I'm developing a custom control. One of the requirements is to draw lines. Although this works, I noticed that my 1 pixel wide lines do not really look like 1 pixel wide lines - I know, they're not really pixels but you know what I mean. They look…
Roger
  • 4,737
  • 4
  • 43
  • 68
15
votes
4 answers

How to draw a circle path with color gradient stroke

I want to draw a circle with color gradient stroke like the following picture, on both iOS and macOS: Is it possible to implement with CAShapeLayer or NSBezierPath/CGPath? Or any other ways?
venj
  • 563
  • 1
  • 3
  • 14
14
votes
2 answers

NSBezierPath drawing

I want to do a rounded rectangle outline on an NSImage and I figured that using NSBezierPath would be the best way. However, I ran into a problem: instead of drawing a nice curve, I get this: For reasons I can't understand, NSBezierPath is drawing…
Alex
  • 5,009
  • 3
  • 39
  • 73
13
votes
2 answers

Custom NSView with rounded corners and drop shadow

I'm trying to create a custom NSView with both rounded corners and a drop shadow. I created an NSView subclass and have the following drawRect: method - (void)drawRect:(NSRect)dirtyRect { NSRect rect = NSMakeRect([self bounds].origin.x + 3,…
Lou Howard
  • 131
  • 1
  • 1
  • 3
13
votes
1 answer

IOS : Animate transformation from a line to a bezier curve

I would like to animate a straight line curving into a bezier curve (from "_" to "n"), is there a library somewhere that can help me to do it ? I know how to draw a Bezier curve with UIBezierPath, I could redraw rapidly and progressively do the…
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
10
votes
5 answers

Get center points of a UIBezierpath

I am able to generate the UIBezierPath of characters with whatever selected font and size. Now I want to make an etched line in between the bezier path. Can I get the center points of the bezier path along? Or any other way that I can make the…
NiKKi
  • 3,296
  • 3
  • 29
  • 39
9
votes
2 answers

NSBezierPath rounded rectangle has bad corners

I have an NSBezierPath that makes a rounded rectangle but the corners of it look choppy and appear brighter that the rest of the stroke when viewed at full scale. My code is: NSBezierPath *path = [NSBezierPath bezierPath]; [path…
nosedive25
  • 2,477
  • 5
  • 30
  • 45
7
votes
3 answers

Cut a rectangle out of an NSBezierPath

Is it possible to remove a chunk of NSBezierPath that is defined by an NSRect region within the path?
Kristina
  • 15,859
  • 29
  • 111
  • 181
6
votes
2 answers

Iphone application performance is slowing down with out any memory leak?

I have a IPhone drawing application which is slowing down when I use the spray can tool. But when I check for leaks by running the application with leaks no leaks are shown. All other tools are working fine can some help me out in resolving this…
Ravi shankar
  • 2,450
  • 1
  • 25
  • 34
6
votes
2 answers

How to use NSPointArray?

So I want to use the method appendBezierPathWithPoints:count: in NSBezierPath. But the method requires me to use NSPointArray. The documentary doesn't really talk much about it and all I could get about it is that it's an array of NSPoints and…
TheAmateurProgrammer
  • 9,252
  • 8
  • 52
  • 71
6
votes
1 answer

Drawing varying line widths with NSBezierPath?

I would like to create a vector object that can be drawn with a pen tablet and will honor the pressure information from the pen (by increasing/decreasing line width appropriately). Now I know how to get the pressure info out of the NSEvent, but of…
uliwitness
  • 8,532
  • 36
  • 58
5
votes
1 answer

Can I use CALayer to speed up view rendering?

I am making a custom NSView object that has some content that changes often, and some that changes much more infrequently. As it would turn out, the parts that change less often take the most time to draw. What I would like to do is render these two…
mtmurdock
  • 12,756
  • 21
  • 65
  • 108
1
2 3
9 10