• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Quartz2D paths from vector?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quartz2D paths from vector?


  • Subject: Quartz2D paths from vector?
  • From: Paul Reilly <email@hidden>
  • Date: Wed, 17 Feb 2010 19:02:10 +0000

Hello,

I'm trying to draw shapes, and have read the Quartz 2D graphics guide.
I can draw things like a romantic "heart" shapes [1] using NSBezier curves,
with methods like  CGContextAddCurveToPoint.

However this is quite difficult to draw by numbers. I would like to draw my
shapes
in something like Illustrator or Photoshop and then export the Path as a
vector path,
.AI or .EPS, and then convert that in to a set of points for NSBezier Path
to use.

Is anyone aware of a tool that will do that?
Or is there any other way to import a curve path in to Quartz, without
having to define
it manually in code?

Thanks,

Paul

[1]
 // construct and draw a heart shaped path
 CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor);
 CGContextSaveGState(context);
 float kHalfSize = 200.0;
 CGContextTranslateCTM(context, kHalfSize / 2, kHalfSize / 2);
 CGContextMoveToPoint(context, 0, 21);
 CGContextAddCurveToPoint(context, -16, 49.8,-53.2, 41.0, -49.6, 5.8);
 CGContextAddCurveToPoint(context, -46, -29.4,-9.4, -53.4, 0, -69.8);
 CGContextAddCurveToPoint(context, 9.4, -53.4,46, -29.4, 49.6, 5.8);
 CGContextAddCurveToPoint(context, 53.2, 41, 16, 49.8, 0, 21);
 CGContextClosePath(context);
 CGContextStrokePath(context);
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Quartz2D paths from vector?
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: alternative to NSMatrix due to cell size restriction
  • Next by Date: Re: Appropriate -setWantsLayer: timing
  • Previous by thread: Re: Debugging "NSManagedObject with ID has been invalidated"
  • Next by thread: Re: Quartz2D paths from vector?
  • Index(es):
    • Date
    • Thread