1
2 #include <ming.h>
3
main(int argc,char * argv[])4 int main(int argc, char *argv[])
5 {
6 SWFMovie movie;
7 SWFShape shape;
8 FILE *file_bitmap;
9 SWFBitmap bitmap;
10 SWFFill fill;
11 SWFDisplayItem timeline;
12 char *dblFile = "png.dbl";
13
14 Ming_init(argc, argv);
15 Ming_useSWFVersion(5);
16 movie= newSWFMovie();
17 SWFMovie_setDimension(movie, 32, 32);
18 SWFMovie_setRate(movie, 12);
19 SWFMovie_setNumberOfFrames(movie, 1);
20 shape= newSWFShape();
21
22 if(!(file_bitmap= fopen(dblFile,"rb")))
23 {
24 printf("Couldn't find file %s\n", dblFile);
25 }
26
27 bitmap = (SWFCharacter) newSWFDBLBitmap(file_bitmap);
28 fill= SWFShape_addBitmapFill(shape, bitmap, SWFFILL_TILED_BITMAP);
29 SWFShape_setRightFill(shape, fill);
30 SWFShape_drawLineTo(shape, 32.00, 0.00);
31 SWFShape_drawLineTo(shape, 32.00, 32.00);
32 SWFShape_drawLineTo(shape, 0.00, 32.00);
33 SWFShape_drawLineTo(shape, 0.00, 0.00);
34
35 timeline= SWFMovie_add(movie, (SWFBlock) shape);
36 SWFDisplayItem_moveTo(timeline, 0.00, 0.00);
37 SWFMovie_nextFrame(movie);
38 SWFMovie_save(movie, "png.swf");
39
40 fclose(file_bitmap);
41 return 0;
42 }
43
44
45