Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database
workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!
"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"
C# Article: Create, Open, Load, Save, Import,
Export, Edit, SVG File Document With C#, SVG .NET Class
A simple C# application
and a C# class library
for editing SVG documents.
article presents the
SVGPad application, a
simple C# tool designed
for editing SVG documents.
The SVGPad is a very simple editor
(it is not a WYSIWYG application) that can be useful for
learning SVG syntax and
for building simple SVG documents.
It provides a complete control over the
SVG document generated
(and this is not always true if you use a
article assumes that you
are familiar with basic concepts of
Scalable Vector Graphics (SVG),
an XML application that
provides a language to describe two-dimensional graphics.
SVG specification is published by W3C and can
be found here:
SVG graphics are based on three different
types of objects: vector graphics,
images, and text. Graphical objects
can be grouped, styled, transformed, and animated. Animation
is performed via scripting since a rich set of event
handlers (such as onmouseover, onclick, …) can be assigned
to any SVG object.
SVG has several benefits that make it the best
choice for web applications that need
2D graphic support. Because it is a
vector format the
graphic files are
smaller and they are resolution independent. In addition
since graphics are stored in a text file labels and
descriptions can be indexed by search engines.
How it works
The SVGPad UI is
divided in two main panes.
The left pane contains
a tree that represents the SVG
document. The right pane contains a PropertyGrid
displaying the property of the current selected object on
the tree and a text box that shows the
SVG representation of the selected object. The
PropertyGrid shows only the attributes that are suitable for
the element type selected.
functionality can be accessed using the toolbar of via the
tree context menu.
elements and attributes
The SVGPad does not
cover all the SVG
elements and attributes; in this first release it just
implements the most common elements:
For each element a
subset of SVG attributes is
create a new empty
SVG document from a
save the current
Preview, open the
SVG file in the
default web browser.
Copy, copy the
selected SVG element.
Cut, cut the
Paste, paste the
element in the clipboard.
Delete, delete the
Element up, move
the selected element up (before its previous element)
Element down, move
the selected element down (after its next element)
Level up, move the
selected element up one level in a hierarchy
The SVGPad application
is based on the SVGLib C# class
library. The SVGLib provides a set of classes
that represent the SVG document,
the SVG elements and
attributes. It can be used for creating and managing SVG
The SVGLib classes have
been documented using NDoc and the chm file is included in
the attached binary file zip.
Using the SVGLib is
very simple; first of all you need to create a
SvgDoc doc = new SvgDoc();
SvgRoot root = doc.CreateNewDocument();
root.Width = "500px";
root.Height = "500px";
Then you can start
SvgRect rect = new SvgRect(doc,
rect.RX = "2px";
rect.RY = "2px";
SvgCircle circle1 = new SvgCircle(doc,
circle1.Fill = Color.DarkBlue;
SvgCircle circle2 = new SvgCircle(doc,
circle2.Fill = Color.DarkBlue;
Finally you can
Here the created file
shown in a web browser.