1 #include <mingpp.h>
2 #include <cstdlib>
3
4
main()5 int main()
6 {
7 try {
8 SWFMovie *m = new SWFMovie(8);
9 SWFShape *shape = new SWFShape();
10 SWFShape *shape2 = new SWFShape();
11 SWFBitmap *bmp = new SWFBitmap(MEDIADIR"/image01.png");
12 SWFGradient *g = new SWFGradient();
13
14 g->addEntry(0.0, 0xff, 0xff, 0, 0x88);
15 g->addEntry(0.3, 0, 0xff, 0, 0x33);
16 g->addEntry(0.7, 0, 0, 0xff, 0x33);
17 g->addEntry(1.0, 0xff, 0, 0, 0x88);
18
19 SWFFillStyle *fill = SWFFillStyle::BitmapFillStyle(bmp,
20 SWFFILL_TILED_BITMAP);
21 SWFFillStyle *fill2 = SWFFillStyle::GradientFillStyle(g,
22 SWFFILL_LINEAR_GRADIENT);
23
24
25 shape->setLine2Filled(40, fill, SWF_LINESTYLE_FLAG_HINTING |
26 SWF_LINESTYLE_JOIN_BEVEL | SWF_LINESTYLE_FLAG_ENDCAP_SQUARE, 0);
27 shape->movePenTo(5, 5);
28 shape->drawLineTo(50, 100);
29 shape->drawLineTo(100, 100);
30
31 m->add(shape);
32
33 shape2->setLine2Filled(10, fill2, SWF_LINESTYLE_FLAG_HINTING |
34 SWF_LINESTYLE_JOIN_ROUND | SWF_LINESTYLE_FLAG_ENDCAP_ROUND, 0);
35 shape2->movePenTo(125, 125);
36 shape2->drawLineTo(150, 100);
37 shape2->drawLineTo(200, 200);
38 shape2->drawLineTo(250, 100);
39
40 m->add(shape2);
41 m->save("test03.swf");
42 }
43 catch(SWFException &e)
44 {
45 std::cerr << "SWFException: " << e.what() << std::endl << std::endl;
46 return EXIT_FAILURE;
47 }
48 return 0;
49 }
50
51