1 #include <mingpp.h>
2 #include <cstdlib>
3
main()4 int main()
5 {
6 try {
7 SWFMovie *m = new SWFMovie(8);
8 SWFGradient *g = new SWFGradient();
9
10 g->setSpreadMode(SWF_GRADIENT_REPEAT);
11 g->setInterpolationMode(SWF_GRADIENT_LINEAR);
12
13 g->addEntry(0, 0, 0, 0, 255);
14 g->addEntry(0.2, 0, 10, 0, 255);
15 g->addEntry(0.3, 110, 0, 10, 255);
16 g->addEntry(0.4, 20, 0, 0, 255);
17 g->addEntry(0.5, 0, 20, 0, 255);
18 g->addEntry(0.6, 0, 0, 20, 255);
19 g->addEntry(0.7, 30, 0, 0, 255);
20
21 g->addEntry(0.8, 0, 30, 0, 255);
22 g->addEntry(0.9, 0, 0, 30, 255);
23
24 SWFFillStyle *fill = SWFFillStyle::GradientFillStyle(g, SWFFILL_LINEAR_GRADIENT);
25 SWFShape *shape = new SWFShape();
26 shape->useVersion(SWF_SHAPE4);
27 shape->setRightFillStyle(fill);
28
29 shape->setLine(1, 0,0,0,255);
30 shape->drawLine(100, 0);
31 shape->drawLine(0, 100);
32 shape->drawLine(-100, 0);
33 shape->drawLine(0, -100);
34
35 m->add(shape);
36 m->save("test05.swf");
37 }
38 catch(SWFException &e)
39 {
40 std::cerr << "SWFException: " << e.what() << std::endl << std::endl;
41 return EXIT_FAILURE;
42 }
43 return 0;
44
45 }
46