root/test/FillStyle/test02.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <libming.h>

int main()
{
        SWFMovie m = newSWFMovieWithVersion(8);
        FILE *file = fopen(MEDIADIR "/image01.jpeg", "rb");
        if(file == NULL)
        {
                perror(MEDIADIR "/image01.jpeg");
                exit(EXIT_FAILURE);
        }

        SWFJpegBitmap img = newSWFJpegBitmap(file);
        SWFFillStyle fill = newSWFBitmapFillStyle((SWFCharacter)img, SWFFILL_TILED_BITMAP);
        SWFShape shape = newSWFShape();
        SWFShape_setRightFillStyle(shape, fill);
        
        SWFShape_setLine(shape, 1, 0,0,0,255);
        SWFShape_drawLine(shape, 100, 0);
        SWFShape_drawLine(shape, 0, 100);
        SWFShape_drawLine(shape, -100, 0);
        SWFShape_drawLine(shape, 0, -100);

        SWFMovie_add(m, (SWFBlock)shape);
        SWFMovie_save(m, "test02.swf");
        return 0;

}

/* [<][>][^][v][top][bottom][index][help] */