Re: Cropping NSBezierPath
Re: Cropping NSBezierPath
- Subject: Re: Cropping NSBezierPath
- From: Erik Buck <email@hidden>
- Date: Wed, 3 Jan 2007 06:28:07 -0800 (PST)
You need to be more precise in your question.
Crop normally means to select a sub-rectangle of a larger rectangle. If you want to do that, I suggest setting the frame and bounds of the view that you use to draw graphics. The following link includes an example of cropping.
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/Coordinates/chapter_3_section_3.html
I dont know what you mean by particular part of bezier path. From the description of you application, you probably have many paths. I suspect it is very inefficient to try and draw lots of disconnected shapes with a single path.
Nevertheless, you may want to use clipping paths (which apply to graphics contexts).
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/GraphicsContexts/chapter_3_section_3.html
I highly recommend that you read an introductory graphics text book. Cocoa/Quartz uses the Postscript/PDF imaging model which in turn is based on 40 years of computer graphics theory. You might also enjoy the graphics chapters of "Cocoa Programming" http://www.amazon.com/exec/obidos/ASIN/0672322307/ref=ase_stepwisecom-20/104-8297687-8154346
I assume you are writing your SVG viewer as some kind of student project. If not, consider using any available built-in SVG rendering support from Web Kit and/or PDF Kit.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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