|
Boost-Commit : |
From: pbristow_at_[hidden]
Date: 2008-05-24 12:35:16
Author: pbristow
Date: 2008-05-24 12:35:15 EDT (Sat, 24 May 2008)
New Revision: 45725
URL: http://svn.boost.org/trac/boost/changeset/45725
Log:
Examples to show use of SVG and build an image of all colors, but unfinished (barely started!?)
Added:
sandbox/SOC/2007/visualization/libs/svg_plot/example/svg_colors.cpp (contents, props changed)
Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/svg_colors.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/svg_colors.cpp 2008-05-24 12:35:15 EDT (Sat, 24 May 2008)
@@ -0,0 +1,41 @@
+// svg_colors.cpp
+
+// Copyright Paul A. 2007
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+// Example to display all the SVG 1.1 named colors as rectangles.
+// Need completion to all colors, not just one!
+
+// -----------------------------------------------------------------
+// Deals with colors that have special names. The reason that the
+// underscore separator convention does not match the normal Boost format
+// is that these names that are specified by the SVG standard.
+// http://www.w3.org/TR/SVG/types.html#ColorKeywords
+// -----------------------------------------------------------------
+enum svg_color_constant
+#include svg.hpp;
+using svg::rect;
+
+#include <boost/svg_plot/svg_1d_plot.hpp>
+using namespace boost::svg;
+
+int main()
+{
+ svg& rect(double x1, double y1, double width, double height);
+ svg my_doc;
+
+ my_doc.background_border_color(black)
+ .legend_on(true)
+ .title("SVG standard colors")
+ .x_range(0, 1);
+
+ my_doc.rect(20, 20, 0, 0);
+
+ my_doc.write("./1d_simple.svg");
+ return 0;
+}
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk