一、实际代码
#include "acllib.h" int Setup() { initWindow("Sun",DEFAULT,DEFAULT,400,400); beginPaint(); setBrushColor(RED); setPenColor(RED); chrod(40,40,80,80,0,0,0,0); setPenColor(BLACK); setPenWidth(3); line(60,10,60,30); line(60,90,60,110); line(90,60,110,60); line(30,60,10,60);//上下右左 line(40,40,20,30); line(40,80,20,90); line(80,40,100,30); line(80,80,100,90); endPaint(); beginPaint(); setTextSize(20); paintText(50, 200, "Have a good time every day"); endPaint(); beginPaint(); // 脸 setBrushColor(YELLOW); setPenColor(BLACK); setPenWidth(2); ellipse(150, 250, 250, 350); // 圆形脸 // 眼睛 setBrushColor(WHITE); ellipse(170, 280, 190, 300); // 左眼 ellipse(210, 280, 230, 300); // 右眼 setBrushColor(BLACK); ellipse(175, 285, 185, 295); // 左眼珠 ellipse(215, 285, 225, 295); // 右眼珠 // 笑的弧线嘴巴 setPenWidth(3); setBrushColor(TRANSPARENT); arc(170, 310, 230, 330, 0, 180, 0, 3); endPaint(); return 0; }
二、效果
这里的脸画的很抽象