test05.c

来自「Ming is a library for generating Macrome」· C语言 代码 · 共 37 行

C
37
字号
#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <libming.h>int main(){	SWFMovie m = newSWFMovieWithVersion(8);	SWFDBLBitmapData img = newSWFDBLBitmapData_fromPngFile(MEDIADIR "/image01.png");	if ( ! img )	{		fprintf(stderr, "Could not create bitmap from png file "MEDIADIR"/image01.png\n");		return EXIT_FAILURE;	}		SWFFillStyle fill = newSWFBitmapFillStyle((SWFCharacter)img, SWFFILL_CLIPPED_BITMAP);	if ( ! fill )	{		fprintf(stderr, "Could not create bitmap from file "MEDIADIR"/image01.png\n");		return EXIT_FAILURE;	}	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, "test05.swf");	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?