1 
2 #include <ming.h>
3 
main(int argc,char * argv[])4 int main(int argc, char *argv[])
5 {
6    SWFMovie m;
7    SWFShape shape;
8    FILE *file_bitmap;
9    SWFBitmap b;
10    SWFFill fill;
11    float height= 480.0;
12    float width= 640.0;
13 
14 
15    Ming_init(argc, argv);
16    Ming_useSWFVersion(5);
17    m= newSWFMovie();
18    SWFMovie_setDimension(m, width, height);
19 
20    shape= newSWFShape();
21    if(!(file_bitmap= fopen("backyard.jpg","rb")))
22    {
23        printf("Couldn't find file backyard.jpg");
24    }
25    b= (SWFCharacter) newSWFJpegBitmap(file_bitmap);
26 
27    fill= SWFShape_addBitmapFill(shape, b, SWFFILL_TILED_BITMAP);
28 
29    SWFShape_setRightFill(shape, fill);
30    SWFShape_drawLineTo(shape, width,  0.00);
31    SWFShape_drawLineTo(shape, width, height);
32    SWFShape_drawLineTo(shape, 0.00, height);
33    SWFShape_drawLineTo(shape, 0.00, 0.00);
34 
35    SWFMovie_add(m, (SWFBlock) shape);
36 
37    SWFMovie_save(m, "jpegfill.swf");
38 
39    fclose(file_bitmap); /* Do not close earlier or an error will happen */
40    return 0;
41 }
42 
43 
44