第一种加载方法- (void)drawRect:(CGRect)rect { UIBezierPath *backPath = [UIBezierPath bezierPath]; [backPath moveToPoint:CGPointMake(0, 0)]; [backPat...
分类:
其他好文 时间:
2015-09-01 21:30:22
阅读次数:
259
//获取上下文 CGContextRef context =UIGraphicsGetCurrentContext(); //线条加粗 CGContextSetLineWidth(context , 5);CGContextSetLineWidth(context, 5); CGRect rect ...
分类:
其他好文 时间:
2015-08-29 09:39:17
阅读次数:
142
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight){ float fw, fh; if (ovalWi...
分类:
其他好文 时间:
2015-08-28 15:27:44
阅读次数:
124
::GetWindowDC(m_hWnd); // 表示GetWindowDC()是一个全局函数,作用域大GetWindowDC()获得的设备环境覆盖了整个窗口(包括非客户区),例如标题栏、菜单、滚动条,以及边框GetWindowRect() rect表示应用程序窗口在屏幕中的位置rigth lef...
//UIColor 转UIImage - (UIImage*) createImageWithColor: (UIColor*) color { ????CGRect?rect=CGRectMake(0,?0,?1,?1); ????UIGraphicsBeginImageContext(rect.size); ????CGContextRef?conte...
分类:
移动开发 时间:
2015-08-26 18:06:39
阅读次数:
265
1?点击-UITapGestureRecognizer ????override?func?viewDidLoad()?{
????????super.viewDidLoad()
???????????????
????????let?rect=CGRect(x:80,y:200,width:200,heig...
分类:
移动开发 时间:
2015-08-26 14:07:53
阅读次数:
159
一、图形上下文栈1.自定义一个MJView,继承自UIView2.将默认View的Class设置为MJView3.实现drawRect:方法-(void)drawRect:(CGRect)rect{ //1.获得上下文 CGContextRef ctx = UIGraphicsGetCurr...
分类:
移动开发 时间:
2015-08-21 20:50:33
阅读次数:
244
Ios“巷自己的定义View和Android类别似在.h文件设置了他的一些财产。方法在.m文件中实现.h文件#import CGPoint CGRectGetCenter(CGRect rect);CGRect CGRectMoveToCenter(CGRect rect,CGPoint cente...
分类:
其他好文 时间:
2015-08-20 22:23:58
阅读次数:
166
出现这个问题的童鞋,几乎都是因为用了Xcode6。原因:在Xcode6之前,创建的文件系统会自动为用户导入Foundation.h和UIKit.h文件,但是最新的Xcode6只为用户导入了Foundation.h文件,缺少一个。所以,解决方案是:自己在头文件部分导入即可:#import 这个问题,g...
分类:
移动开发 时间:
2015-08-20 18:47:06
阅读次数:
376
3-4 长方形的周长和面积计算 Time Limit: 1000MS Memory limit: 65536K 标题叙述性说明通过本题的练习能够掌握拷贝构造函数的定义和用法;设计一个长方形类Rect。计算长方形的周长与面积。类中有私有数据成员Length(长)、Width(宽)。由具有缺省參数值的构...
分类:
其他好文 时间:
2015-08-20 10:23:51
阅读次数:
185