- 浏览: 340244 次
- 性别:
- 来自: 武汉
文章分类
最新评论
-
leslie89757:
[img][img][img][img][img][img][ ...
CocoaPods 安装使用 -
hanmeizhi:
very useful to me. Thanks
Dismissing MPMoviePlayerViewController the right way -
luzj:
这个考虑不周全, 在iOS5的键盘高度就不是这个值了,这样写死 ...
UITextView: move view when keyboard appears -
xjg19870111:
不错。
objective-c NSString 常用操作 -
juedui0769:
现在已经不行了!
android源码下载
虚线:
切线:
An arc may be drawn by specifying two tangent points and a radius using the CGContextAddArcToPoint() function:
Drawing an Ellipse or Circle
Circles and ellipses are drawn by defining the rectangular area into which the shape must fit and then calling the CGContextAddEllipseInRect() function:
Drawing a Cubic Bézier Curve
A cubic Bézier curve may be drawn by moving to a start point and then passing two control points and an end point through to the CGContextAddCurveToPoint() function:
Drawing a Quadratic Bézier Curve
A quadratic Bézier curve is drawn using the CGContextAddQuadCurveToPoint() function, providing a control and end point as arguments having first moved to the start point:
Dashed Line Drawing
So far in this chapter we have performed all our drawing with a solid line. Quartz also provides support for drawing dashed lines. This is achieved via the Quartz CGContextSetLineDash() function which takes as its arguments the following:
context – The graphics context of the view on which the drawing is to take place
phase - A floating point value that specifies how far into the dash pattern the line starts
lengths – An array containing values for the lengths of the painted and unpainted sections of the line. For example an array containing 5 and 6 would cycle through 5 painted unit spaces followed 6 unpainted unit spaces.
count – A count of the number of items in the lengths array
For example, a [2,6,4,2] lengths array applied to a curve drawing of line thickness 5.0 will appear as follows:
The corresponding drawRect code that drew the above line reads as follows:
CGContextSetStrokeColorWithColor(myContext, [UIColor blackColor].CGColor); CGContextSetLineDash (myContext,phase,lengths,2); CGContextClosePath(myContext); CGContextStrokePath(myContext);
切线:
An arc may be drawn by specifying two tangent points and a radius using the CGContextAddArcToPoint() function:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGContextMoveToPoint(context, 100, 100); CGContextAddArcToPoint(context, 100,200, 300,200, 100); CGContextStrokePath(context); }
Drawing an Ellipse or Circle
Circles and ellipses are drawn by defining the rectangular area into which the shape must fit and then calling the CGContextAddEllipseInRect() function:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGRect rectangle = CGRectMake(60,170,200,80); CGContextAddEllipseInRect(context, rectangle); CGContextStrokePath(context); }
Drawing a Cubic Bézier Curve
A cubic Bézier curve may be drawn by moving to a start point and then passing two control points and an end point through to the CGContextAddCurveToPoint() function:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGContextMoveToPoint(context, 10, 10); CGContextAddCurveToPoint(context, 0, 50, 300, 250, 300, 400); CGContextStrokePath(context); }
Drawing a Quadratic Bézier Curve
A quadratic Bézier curve is drawn using the CGContextAddQuadCurveToPoint() function, providing a control and end point as arguments having first moved to the start point:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGContextMoveToPoint(context, 10, 200); CGContextAddQuadCurveToPoint(context, 150, 10, 300, 200); CGContextStrokePath(context); }
Dashed Line Drawing
So far in this chapter we have performed all our drawing with a solid line. Quartz also provides support for drawing dashed lines. This is achieved via the Quartz CGContextSetLineDash() function which takes as its arguments the following:
context – The graphics context of the view on which the drawing is to take place
phase - A floating point value that specifies how far into the dash pattern the line starts
lengths – An array containing values for the lengths of the painted and unpainted sections of the line. For example an array containing 5 and 6 would cycle through 5 painted unit spaces followed 6 unpainted unit spaces.
count – A count of the number of items in the lengths array
For example, a [2,6,4,2] lengths array applied to a curve drawing of line thickness 5.0 will appear as follows:
The corresponding drawRect code that drew the above line reads as follows:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 5.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGFloat dashArray[] = {2,6,4,2}; CGContextSetLineDash(context, 3, dashArray, 4); CGContextMoveToPoint(context, 10, 200); CGContextAddQuadCurveToPoint(context, 150, 10, 300, 200); CGContextStrokePath(context); }
发表评论
-
IOS7.1 企业应用 证书无效 已解决
2014-05-10 10:53 774http://www.cocoachina.com/bbs/r ... -
xCode Find&Replace快捷键
2013-10-28 10:44 907As for Find & Replace, they ... -
iOS整合zxing需要注意的地方
2013-08-02 23:34 2106Well, at last I got it working. ... -
iOS 自定义Tabbar
2013-07-30 22:55 1191http://www.appcoda.com/ios-prog ... -
Apple Push Notification Service总结
2013-07-29 22:39 1115苹果推送通知服务使用总结 1. 在 Mac 上从 KeyCha ... -
iOS 消息推送原理及实现
2013-07-12 13:40 856链接: http://www.dapps.net/dev/ ... -
GIMP IMAGE MAP
2013-05-29 16:13 853使用GIMP 制作 IMAGE MAP 1. 选择图片,用G ... -
INSPIRATION
2013-05-27 18:21 813http://www.patternsofdesign.co. ... -
iOS 自定义控件系列
2013-05-27 17:09 1481iOS自定义控件 自定义UITableViewCell ht ... -
CocoaPods 使用教程
2013-05-27 14:49 768http://mobile.tutsplus.com/tuto ... -
IOS 开发之设置UIButton的title
2013-05-11 22:03 1207btn.frame = CGRectMake(x, y, wi ... -
REActivityViewController 使用 备忘
2013-04-22 21:38 1058REActivityViewController Out o ... -
VPS配置二级域名
2013-04-18 23:08 7881. 域名解析商配置泛解析 主机记录 * 记录类型 A 2. ... -
ios 开发NewsStand指南
2013-04-13 21:44 1324http://www.viggiosoft.com/blog/ ... -
Python Django mod_wsgi Windows 部署过程 备忘
2013-04-10 18:28 1587部署环境:Windows2003Server 1. 安装Ap ... -
网站迁移 备忘
2013-04-10 14:58 7511. 备份数据库。。。导出的格式和编码要注意 2. 完全导出网 ... -
Windows下命令行查看端口占用
2013-04-09 23:42 723在windows命令行窗口下执行: C:\>netst ... -
带预览功能又可分页的UIScrollView
2013-04-05 12:56 823带预览功能又可分页的UIScrollView http:// ... -
25 iOS App 性能优化
2013-04-05 10:51 695http://www.raywenderlich.com/ ... -
UIScrollView滚动, 中间显示整图, 前后露出部分图
2013-04-04 00:12 1200UIScrollView *scrollowView = [[ ...
相关推荐
NXDrawKit, NXDrawKit是一款简单而简单但实用的iPhone绘图工具 它刚开始为我的个人iPhone应用。 但是,它不能像你所需的那样定制,你可以使用平滑徒手绘制视图查看。 我为使用 Canvas 制作了 Palette 和 ToolBar,...
iPhone/iPad 绘图应用 Brushes ,Brushes 是一个绘图应用,支持 iPhone, iPod touch 和 iPad。
### 关于Quartz 2D在iPhone应用开发中的应用 #### 一、Quartz 2D概述 Quartz 2D是一种高级的二维图形引擎,适用于iPhone应用程序开发以及所有Mac OS X应用程序环境(内核之外)。它提供了低级别的轻量级2D渲染,...
Swift-NXDrawKit 是一款专为 iPhone 设计的轻量级绘图库,它提供了丰富的功能,让开发者能够轻松地在 iOS 应用程序中集成画板功能。这个库是用 Swift 语言编写的,因此它充分利用了 Swift 的强大特性和易用性,使得...
C 开发的绘图程序, 包括直线,椭圆 ,矩形,曲线,撤销,清屏,颜色和线性设定,图片保存,以及相册中的图片处理功能(图片移动,放大,缩小),以及其他各种功能,集各种功能与一身,代码清晰,简洁易懂,非常适合iphone初学者.
根据提供的标题“iPhone狂:约会iPhone”以及描述“iPhone狂:约会iPhone”,我们可以理解这篇文章主要聚焦于iPhone的相关内容。然而,由于正文部分并未提供具体的信息或数据,我们将基于标题和描述来探讨与iPhone...
### 关于《Beginning iPhone Development: Exploring the iPhone SDK》的知识点总结 #### 一、书籍简介与适用对象 《Beginning iPhone Development: Exploring the iPhone SDK》是一本面向初学者的iPhone应用程序...
此外,这个库可能还包含了iPhone的屏幕尺寸适配元素,例如针对不同尺寸的iPhone(如iPhone SE、iPhone 8、iPhone X系列)的布局和组件。 使用这个元件库,原型设计师无需从零开始绘制每个组件,可以直接拖放这些...
【标题】"C#绘图源代码"涵盖了C#编程语言在图形绘制方面的应用,主要集中在使用C#的图形库和API进行图形界面的设计与实现。C#是一种面向对象的编程语言,它提供了丰富的功能来支持图形用户界面(GUI)的创建,包括...
《Iphone开发基础教程》第十二章实用Quartz和OpenGL绘图(之Quartz绘图),源代码下载!具体的讲解在我的blog上面,blog.sina.com.cn/wanmeiguanjun.欢迎指点!
《iPhone4、iPhone4s、iPhone5 完美越狱工具包详解》 在iOS设备的世界里,"越狱"一词对许多用户而言并不陌生。越狱是指通过技术手段解除Apple公司对iPhone等设备的封闭系统限制,使得用户能够自定义设备、安装非App...
《iPhone 11维修资料详解》 在当今的科技时代,智能手机已经成为我们日常生活的重要组成部分,尤其是像iPhone 11和iPhone 11 Pro这样的高端设备。这些设备集成了先进的技术,为用户带来了卓越的体验。然而,随着...
对于iPhone元件库,其涵盖了多种iPhone机型,例如iPhone SE、iPhone 6/6S/7/8系列、iPhone X/XS系列、iPhone XR、iPhone 11系列、iPhone 12系列以及iPhone 13系列等。这些模型不仅包括手机的外观,还可能包括屏幕...
在IT领域,特别是移动设备部分,苹果公司的iPhone一直以其独特的用户体验和设计著称。其中,iPhone的提示音是用户日常操作中不可或缺的一部分,它们为用户提供了一系列声音反馈,以告知用户各种事件的发生。在这个名...
"Axure元件库iPhone"是专门为设计iPhone应用原型而定制的一套元件集合。该库不仅提高了设计效率,还确保了设计的准确性和一致性,因为这些元件都是按照iOS设备的界面规范和设计风格制作的。 首先,我们来看一下...
iphone X iphone 8 原型框 iphone X iphone 8 原型框
标题中的“iphone13通用ipcc49.0.zip”表明这是一个与苹果iPhone 13设备相关的软件更新或配置文件,IPCC(International Provider Configuration)是Apple用来管理运营商设置的一种文件格式。这些设置通常涉及手机的...
标题 "iphone13 ios ipcc52.0.zip" 暗示了这可能是一个针对iPhone 13设备的iOS更新文件,其中包含了IPCC(International Provider Configuration)文件。IPCC文件是苹果设备用于设置运营商配置的重要文件,它通常...
想在普通电脑上让你发表的空间说说显示来自iPhone嘛?火狐专用浏览器就可以实现这个效果!不但可以显示发布的说说来自iPhone触屏版,还可以显示iPad或android,绝对给力,不管你信不信,反正我是信了,我已经测试100%...