author | francesco-ST <francesco.abbate@st.com> | 2010年07月27日 16:54:48 +0200 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2010年07月27日 16:54:48 +0200 |
commit | d28a8f579f2e902f5bced91cbb726f7eca32b3a1 (patch) | |
tree | 7d77805417cbb0ae41bdbd2b57a0933617e3a244 /agg-plot/wtest.cpp | |
parent | 5b7cd1356fb503390febbc21b2d535e98de7f776 (diff) | |
download | gsl-shell-d28a8f579f2e902f5bced91cbb726f7eca32b3a1.tar.gz |
-rw-r--r-- | agg-plot/wtest.cpp | 26 |
diff --git a/agg-plot/wtest.cpp b/agg-plot/wtest.cpp index f527ae8c..7b8e75df 100644 --- a/agg-plot/wtest.cpp +++ b/agg-plot/wtest.cpp @@ -2,6 +2,7 @@ #include "trans.h" #include "window-trans.h" #include "path.h" +#include "text.h" int main() @@ -10,16 +11,20 @@ main() agg::path_storage& pc = p->get_base(); pc.move_to(0.0, 0.0); - pc.line_to(1.0, 0.0); - pc.line_to(1.0, 1.0); - pc.line_to(0.0, 1.0); + pc.line_to(20.0, 0.0); + pc.line_to(20.0, 20.0); + pc.line_to(0.0, 20.0); pc.close_polygon(); trans::stroke *s1 = new trans::stroke(p); - s1->self().width(10.0); + s1->self().width(4.0); s1->self().line_cap(agg::round_cap); - window_scalable *ws1 = new window_scalable(s1); + double c = 0.707, s= 0.707; + agg::trans_affine rmat(c, s, -s, c, 0.0, 0.0); + trans::affine *rs1 = new trans::affine(s1, rmat); + + window_scalable *ws1 = new window_scalable(rs1); window::stroke *s2 = new window::stroke(ws1); s2->self().width(1.0); @@ -31,9 +36,20 @@ main() agg::trans_affine mtx(200.0, 0.0, 0.0, 100.0, 0.0, 0.0); s2->apply_transform(mtx); + draw::text *txt = new draw::text(12.0); + txt->self().text("Hello world!"); + txt->self().start_point(4.0, 5.0); + + window::dash *d2 = new window::dash(txt); + d2->self().add_dash(2.0, 2.0); + if (s2->dispose()) delete s2; + if (d2->dispose()) + delete d2; + + delete txt; delete p; return 0; |