渲染太極圖

//畫(huà)左邊白色大半圓?
??ras.reset();?
??agg::arc arc(400, 100, 100, 100, 1.57, -1.57,false);?
??ras.add_path(arc);?
??ras.move_to_d(400,0);?
??ras.line_to_d(400,200);?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(255,255,255));?
??ras.reset();?
??agg::arc arc1(400, 100, 100, 100, 1.57, -1.57,true);?
??ras.add_path(arc1);?
??ras.edge_d(400,0,400,200);?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(0,0,0));?
??//繪制上面的白色小半圓?
??ras.reset();?
??agg::arc arc2(400, 50, 50, 50, 1.57, -1.57,true);?
??ras.add_path(arc2);?
??ras.auto_close(true);?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(255,255,255));?
??//繪制下面的黑色小半圓?
??ras.reset();?
??agg::arc arc3(400, 150, 50, 50, 1.57, -1.57,false);?
??ras.add_path(arc3);?
??ras.close_polygon();?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(0,0,0));?
??
??//繪制上面的黑色太極眼?
??ras.reset();?
??agg::ellipse ell(400,50,10,10);?
??ras.add_path(ell);?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(0,0,0));?
??//繪制下面的白色太極眼?
??ras.reset();?
??agg::ellipse ell1(400,150,10,10);?
??ras.add_path(ell1);?
??agg::render_scanlines_aa_solid(ras,sl,renb,agg::rgba8(255,255,255));?
多說(shuō)一句:??ras.close_polygon(); ras.auto_close(true); ras.edge_d(400,0,400,200);都是用來(lái)封閉半弧的,然后才能夠填充顏色!!
了解更多網(wǎng)絡(luò)知識(shí)關(guān)注:http://www.vecloud.com/