From d28a8f579f2e902f5bced91cbb726f7eca32b3a1 Mon Sep 17 00:00:00 2001 From: francesco-ST Date: 2010年7月27日 16:54:48 +0200 Subject: added text graphical object. --- agg-plot/wtest.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'agg-plot/wtest.cpp') 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; -- cgit v1.2.3

AltStyle によって変換されたページ (->オリジナル) /