XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog
 1 #define PSIZE 16    // size of the pattern cell
 2  
 3 static void MyDrawStencilStar (void *info, CGContextRef myContext)
 4 {
 5     int k;
 6     double r, theta;
 7  
 8     r = 0.8 * PSIZE / 2;
 9     theta = 2 * M_PI * (2.0 / 5.0); // 144 degrees
10  
11     CGContextTranslateCTM (myContext, PSIZE/2, PSIZE/2);
12  
13     CGContextMoveToPoint(myContext, 0, r);
14     for (k = 1; k < 5; k++) {
15         CGContextAddLineToPoint (myContext,
16                     r * sin(k * theta),
17                     r * cos(k * theta));
18     }
19     CGContextClosePath(myContext);
20     CGContextFillPath(myContext);
21 }
posted on 2012-11-06 16:09  不及格的程序员-八神  阅读(271)  评论(0编辑  收藏  举报