- (void)drawRect:(CGRect)rect {

UIBezierPath * path = [UIBezierPath bezierPath];

[path moveToPoint:CGPointMake(fView_Width(self)/2., 6*DX_Proportion)];

[path addLineToPoint:CGPointMake(fView_Width(self) - 6*DX_Proportion, 30/2.*DX_Proportion + 6*DX_Proportion)];

[path addLineToPoint:CGPointMake(fView_Width(self) - 6*DX_Proportion, 90/2.*DX_Proportion + 6*DX_Proportion)];

[path addLineToPoint:CGPointMake(fView_Width(self)/2., fView_Height(self) - 6*DX_Proportion)];

[path addLineToPoint:CGPointMake(6*DX_Proportion, 90/2.*DX_Proportion + 6*DX_Proportion)];

[path addLineToPoint:CGPointMake(6*DX_Proportion, 30/2.*DX_Proportion + 6*DX_Proportion)];

[path closePath];

path.lineWidth = 3*DX_Proportion;

[self.linColor set];

[path stroke];

CAShapeLayer * shapLayer = [CAShapeLayer layer];

shapLayer.path = path.CGPath;

self.imageView.layer.mask = shapLayer;

}

iOS开发 画六边形(多边形)的更多相关文章

  1. iOS开发--画一条黑色的横线

    在网上搜索了下大概有下面几种方法: 1.使用Quartz2D画出横线 需要一个UIVIew把这两个Label装起来,你需要计算好他们的位置同时给黑线预留像素的位置.这样你在UIView里面- (voi ...

  2. 【IOS开发】如何画1像素的线

    最近在项目中画了一根1像素的线,我是通过直接花一个但是通过PS查看,画了不止1个像素. 原代码语句: label1 = [[UILabel alloc] initWithFrame:CGRectMak ...

  3. IOS开发基础知识碎片-导航

    1:IOS开发基础知识--碎片1 a:NSString与NSInteger的互换 b:Objective-c中集合里面不能存放基础类型,比如int string float等,只能把它们转化成对象才可 ...

  4. iOS开发 滤镜的使用

    iOS开发之滤镜的使用技巧(CoreImage)   一.滤镜的内容和效果是比较多并且复杂的 ,学习滤镜需要技巧 如下: 两个输出语句解决滤镜的属性选择问题: 1.查询效果分类中包含什么效果按住com ...

  5. iOS开发 贝塞尔曲线

    iOS开发 贝塞尔曲线UIBezierPath - 陌云 时间 2014-03-14 11:04:00  博客园-所有随笔区 原文  http://www.cnblogs.com/moyunmo/p/ ...

  6. iOS开发---集成百度地图完善版

    一.成为百度的开发者.创建应用 http://developer.baidu.com/map/index.php?title=首页 (鼠标移向 然后选择你的项目需要的功能 你可以在里面了解到你想要使用 ...

  7. iOS开发 - Quartz2D画图

    Quartz 2D简单介绍 是一个二维画图引擎,同一时候支持iOS和Mac系统 Quartz 2D能完毕的工作 绘制图形 : 线条\三角形\矩形\圆\弧等 绘制文字 绘制\生成图片(图像) 读取\生成 ...

  8. iOS开发之再探多线程编程:Grand Central Dispatch详解

    Swift3.0相关代码已在github上更新.之前关于iOS开发多线程的内容发布过一篇博客,其中介绍了NSThread.操作队列以及GCD,介绍的不够深入.今天就以GCD为主题来全面的总结一下GCD ...

  9. iOS 开发不可缺少的工具

    1.截屏利器:Snip 强大的滚动截屏功能,你值得拥有! Snip.png 传送门:http://www.snip.qq.com/ 2.Mac上最好的终端模拟器:iTerm2 iTeam.png 传送 ...

随机推荐

  1. Uva 116,单向TSP

    题目链接:https://uva.onlinejudge.org/external/1/116.pdf 和矩形嵌套,巴比伦塔差不多. 题意: 给出矩阵,这个矩阵是环形的,就是说第一行的上一行是最后一行 ...

  2. Poj(2679),SPFA,二级比较

    题目链接:http://poj.org/problem?id=2679 嗯,思路清晰,先DFS看是不是通路,接着就是SPFA找最短路(路是费用,费用相同就比较路的长度). 超哥的代码还有一点问题,初始 ...

  3. 2016年10月30日 星期日 --出埃及记 Exodus 19:15

    2016年10月30日 星期日 --出埃及记 Exodus 19:15 Then he said to the people, "Prepare yourselves for the thi ...

  4. flume+hadoop

    摘自:http://www.kankanews.com/ICkengine/archives/130646.shtml

  5. 无缝漫游 Seamless Roaming

    点击打开链接 如你在由一个以上AP组成的Wifi 无线网中,拿著一部WindowXP 笔记本电脑,乘著汽车在Wifi网中往来,不断通过无线卡Ping 一个目標,你会发现在无线卡过站时,掉包可以高达半分 ...

  6. Bootstrap_排版

    标题: Bootstrap和普通的HTML页面一样,定义标题都是使用标签<h1>到<h6>,只不过Bootstrap覆盖了其默认的样式,使用其在所有浏览器下显示的效果一样,具体 ...

  7. Some Useful Property Settings Explained Of Oracle Forms

    In Oracle forms when we have two or more blocks and there is a requirement to join them or make a re ...

  8. deep-learning-frameworks

    From: http://venturebeat.com/2015/11/14/deep-learning-frameworks/ Here’s a rundown of some other not ...

  9. [51NOD1007] 正整数分组(DP,记忆化搜索)

    题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1007 dp(id, s)表示第id个数之前,其中一个集合和为s ...

  10. JDBC操作Oracle数据库——实际操作过程中的小总结

    1.对数据库中,表的每一行数据记录的增删改查 增:insert into 表名 values() 删:delete 表名 where 条件(id=?) 改:update 表名 set 列名=? whe ...