Fork me on GitHub

2012年4月25日

摘要: http://www.cnblogs.com/delonchen/archive/2011/06/12/CGContextDrawImage.html这个函数绘制图片,但坐标系统原点在左上角,y方向向下的(坐标系A),但在Quartz中坐标系原点在左下角,y方向向上的(坐标系B)。图片绘制也是颠倒的。要达到预想的效果必须变换坐标系,代码如下:void drawImage(CGContextRef context, CGImageRef image , CGRect rect){ CGContextSaveGState(context); CGContextTranslateCTM(co... 阅读全文
posted @ 2012-04-25 19:52 pengyingh 阅读(3377) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/1344767/how-to-draw-a-shape-on-top-of-a-uiimage-while-respecting-the-images-alpha-maskI need a UIImageView that can draw itself in color or b/w according to a flag: BOOL isGrey;I'm trying to do it by drawing a black rectangle on top of the original image with t 阅读全文
posted @ 2012-04-25 18:24 pengyingh 阅读(1190) 评论(0) 推荐(0)
摘要: NSNumberFormatter *formatter=[[NSNumberFormatter alloc]init]; [formatter setGroupingSeparator:@","]; [formatter setGroupingSize:3]; [formatter setUsesGroupingSeparator:YES]; NSNumber *num= [NSNumber numberWithInt:144343]; NSString *str = [formatter stringFromNumber:num]; 结果:144,343 阅读全文
posted @ 2012-04-25 15:37 pengyingh 阅读(826) 评论(0) 推荐(0)

导航