Question Make vector graphics file format

Carbondz.SOFT

New member
Joined
Mar 27, 2013
Messages
3
Location
Jakarta
Programming Experience
Beginner
Hello I am newbie here and I am going to make a vector graphics program. Is is enough to make the variable SmoothingMode.antialias for each Draw. ?

and how to save graphics to file as a vector format file ?
perhaps custom file format ? just like Ai=.ai, corel=.cdr and the other vector programs.


Sorry for my bad English. . .
Thanks :)
 

VicJ

Well-known member
Joined
Aug 12, 2008
Messages
79
Programming Experience
5-10
Assuming you want all the lines in the drawing to be antialiased, you only need to set the SmoothingMode once for the Graphics object with which you are drawing on the screen.

Windows has its own vector file format (WMF/EMF) but unfortunately the .Net framework doesn't provide a way to save files in that format. The format is quite complex and the same applies to proprietary formats like CDR.

But you could start by making a relatively simple scheme to save the data of a drawing. For example, you could define a Class for Lines (with properties like Point1, Point2, PenColor, PenThickness, DashStyle etc.) and similar classes for Arc, Ellipse and so on. Then you could save and retrieve a list of all the elements for a given drawing in your own file format by Serializing a collection of all the elements. If you want to find out more about that kind of approach, I suggest you take a look at OpenS-CAD, a simple 2D CAD application in the CodeProject.

Vic

 

Carbondz.SOFT

New member
Joined
Mar 27, 2013
Messages
3
Location
Jakarta
Programming Experience
Beginner
nice info, I've got more information about vector format, and I found SVG (Scalable Vector Graphics).
but it used by WPF and XAML,

Serializing a collection of all the elements

can you tell me more about that ?
I am new for it, thanks by the way
 
Top Bottom