zoukankan      html  css  js  c++  java
  • Draw a Star using Quartz 2D 不及格的程序员

     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 }
  • 相关阅读:
    activity(工作流)初步学习记录
    npm install出现npm ERR! write after end解决方法
    npm ERR! Cannot read property 'match' of undefined 错误处理
    gist.github.com 被墙无法访问解决办法
    AS SSD Benchmark固态硬盘检测工具
    VSCode 云同步扩展设置 Settings Sync 插件
    window系统不显示预览图片的处理方法
    VsCode如何同时打开多个项目
    win10的开机启动文件夹在哪及开机自动启动软件
    Java环境配置和tomcat环境配置
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2757176.html
Copyright © 2011-2022 走看看