用SimpleCG库画了一个佩奇
大家也可以试下用该库画其他的东西试试https://
程序代码:
#include "stdafx.h" #include "../import/include/CGBoard.h" void DrawProcess() { int nDelay = 500; //衣服 setfillcolor(RGB(230,85,90)); setline(PS_SOLID, 6, RGB(229,47,62)); fillpie( 170, 325, 450, 750, 0, C_PI); Sleep(nDelay); //脸 setlinecolor(RGB(233,144,192)); setfillcolor(RGB(251,174,220)); setlinewidth(4); POINT pt[]= { {460,100}, {275,155}, {200,250},{235,355},{390,360},{435,230},{480,200},{460,100}}; int nLenHead[] = { 10,20,15,30,36,6,0 }; polycurvelinevar( pt, nLenHead, sizeof(pt)/sizeof(POINT) ); floodfill(260,220,RGB(233,144,192),0); fillellipse(430,100, 510, 200); Sleep(nDelay); //鼻子 setfillcolor(RGB(208,110,167)); solidcircle(460, 160, 10); solidcircle(490, 143, 10); Sleep(nDelay); //眼睛 setfillcolor(RGB(255,255,255)); fillcircle(380, 153, 20); setfillcolor(RGB(255,255,255)); fillcircle(330, 173, 20); setfillcolor(0); solidcircle(385, 150, 10); solidcircle(335, 170, 10); Sleep(nDelay); //脸蛋 setfillcolor(RGB(252,139,205)); solidcircle(260, 265, 35); Sleep(nDelay); //耳朵 setfillcolor(RGB(251,174,220)); arc( 270, 90, 310, 155, 2.3*C_PI, C_PI*1.1/2); floodfill(285,118,RGB(233,144,192),0); arc( 220, 110, 260, 185, 2.3*C_PI, C_PI/2.1); floodfill(240,156,RGB(233,144,192),0); Sleep(nDelay); //嘴巴 setline(PS_SOLID, 6, RGB(191,60,128)); arc( 300, 260, 400, 310, C_PI*8/9, -C_PI*0.05); Sleep(nDelay); //手 setline(PS_SOLID, 10, RGB(233,144,192)); curveline(220,385,125,425,8); line(150,415,135,405 ); line(150,415,145,435 ); Sleep(nDelay); curveline(410,385,505,425,-8); line(495,415,505,410 ); line(495,415,490,430 ); Sleep(nDelay); //脚 line(250,535,250,590 ); Sleep(nDelay); line(370,535,370,590 ); Sleep(nDelay); setfillcolor(0); solidpie(250,581,290,599,C_PI/2,-C_PI/2); POINT pt2[]={{245,585},{270,581},{270,598},{245,595}}; solidpolygon(pt2,4); int i=0; for(i=0;i<4;++i) pt2[i].x += 120; Sleep(nDelay); solidpolygon(pt2,4); solidpie(370,581,410,599,C_PI/2,-C_PI/2); Sleep(nDelay); //尾巴 curveline(170,490,135,480,-4); curveline(135,480,140,450,-10); curveline(140,450,160,450,-6); curveline(160,450,150,480,-10); curveline(150,480,110,475,-10); } int _tmain(int argc, _TCHAR* argv[]) { if( !ShowingBoard(600, 700, DrawProcess)) return 1; CloseBoard(); return 0; }