通常我们使用系统自带的UIButton时,一般都是Rect矩形形式的,或则美工给出一张半圆弧的按钮,如图为一张半圆加三角形的按钮,而此时,如果给按钮添加点击事件时,响应事件依然为矩形区域,不符合我们的需求;本文为解决这样的按钮问题:如下图:使用CAShapeLayer和UIBezierPat..
分类:
其他好文 时间:
2015-01-29 10:41:11
阅读次数:
277
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClearRect(context, rect);
CGContextSetLineWidth(context, _lineWidth); ...
分类:
移动开发 时间:
2015-01-28 17:58:57
阅读次数:
183
public class MarqueeTextView extends TextView { @Override?? ????protected?void?onFocusChanged(boolean?focused,?int?direction,?Rect?previouslyFocusedRect)?{?? ????????if(focu...
分类:
其他好文 时间:
2015-01-28 13:13:26
阅读次数:
158
public class MyEditText extends EditText { private Drawable dRight; private Rect rRounds; public MyEditText(Context context) { sup...
分类:
其他好文 时间:
2015-01-27 10:50:51
阅读次数:
193
- (UIImage*) createImageWithColor: (UIColor*) color
{
CGRect rect=CGRectMake(0,0,
1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurren...
分类:
其他好文 时间:
2015-01-26 19:22:52
阅读次数:
226
用NSString中的一个方法,第一个参数是最大的宽度和高度? var rect = temStr.boundingRectWithSize(CGSizeMake(width, frame.height-100), options: NSStringDrawingOptions.UsesLine.....
分类:
移动开发 时间:
2015-01-26 16:26:31
阅读次数:
221
实例 定义和用法shape 属性与 coords 属性配合,可以规定区域的尺寸、形状和位置。详细解释:shape 属性用于定义图像映射中对鼠标敏感的区域的形状:圆形(circ 或 circle)多边形(poly 或 polygon)矩形(rect 或 rectangle)shape 属性的...
分类:
Web程序 时间:
2015-01-22 17:39:28
阅读次数:
271
在这一节中,主要讲目标跟踪的一个重要的算法Camshift,因为它是连续自使用的meanShift,所以这2个函数opencv中都有,且都很重要。为了让大家先达到一个感性认识。这节主要是看懂和运行opencv中给的sample并稍加修改。
Camshift函数的原型为:RotatedRect CamShift(InputArray probImage, Rect& window, ...
分类:
其他好文 时间:
2015-01-19 15:51:42
阅读次数:
274
Rectangles
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 15950 Accepted Submission(s): 5104
Problem Description
Given two rect...
分类:
其他好文 时间:
2015-01-19 10:54:40
阅读次数:
168