Re: Drawing in Cocoa
Re: Drawing in Cocoa
- Subject: Re: Drawing in Cocoa
- From: Robert Clair <email@hidden>
- Date: Fri, 5 Dec 2003 11:01:57 -0500
>
I was thinking that there has to be a better way to do this. I was
>
dreaming about a drawing program that you use to draw all the objects
>
you want, and then dump all the coordinates to a file, and use these
>
coordinates to draw this in a custom view in Cocoa.
>
>
Is this just a dream, or have anyone else been thinking along the same
>
lines?
uh... It's not clear what you are getting at here. This is exactly what
any standard vector drawing program (Illustrator, Freehand, CorelDraw,
etc, etc) does. They let you interactively enter polylines and cubic
Bezier curves (either by dragging the control points or fitting the
curves to a series of points), draw them for you on the screen and save
them to a proprietary or standard file format. If the program happens
to be written in Cocoa it will use the AppKit objects to do the
drawing. If you want to draw them yourself you have to either:
1) Write the code to gather the mouse events and turn them in to lines
and Beziers while providing visual feedback. This activity is referred
to as "writing your own vector drawing program".
2) Learn to read, parse and extract the relevant geometry from the file
format of whatever program you are using. For Illustrator this means
essentially parsing an EPS file (older Illustrator formats), a PDF file
(recent Illustrator formats) or an SVG file. (Current versions of
Illustrator will export SVG). The spec for the Illustrator format is
somewhere on the Adobe web site. It is long and complicated. This is a
fairly painful route to go unless you have some purpose in mind that
can't be accomplished with the original program. For example : "I wrote
my own vector program that works the way I want it to not the way Adobe
wants it to but for commercial purposes I have to be able to read
Illustrator files into it."
......Bob
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone." - Bjarne Stroustrup
"His phone's software was written in C++." - Robert Clair
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.