Fork me on GitHub

2012年4月26日

摘要: I have a UIView that I am trying to render into a UIImage using [CALayer renderInContext:]. However, I find that the resultant image is flipped vertically. I kind of expect this due to the different coordinate systems. However, I then try and flip the context back to normal with an affine transform 阅读全文
posted @ 2012-04-26 14:55 pengyingh 阅读(460) 评论(0) 推荐(0)
摘要: http://www.cocoachina.com/bbs/simple/?t73051.htmlCGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();CGContextRef context = CGBitmapContextCreate(NULL,pageSize.width,/* size_t width */pageSize.height, /* size_t height */8,/* bits per component 32/4 */pageSize.width * 4,/* bytes per row 每行字节数, 阅读全文
posted @ 2012-04-26 14:50 pengyingh 阅读(3890) 评论(0) 推荐(0)
摘要: http://www.cnblogs.com/delonchen/archive/2011/08/03/iostransform.html1.坐标变换的数学基础1.1坐标系数学中我们使用的是笛卡儿坐标系,如下图所示: X轴正方向向右,Y轴正方向向上,原点O,坐标点A(x,y)。1.2仿射变换已知坐标点A,变换后新坐标系中坐标为B ,则有:B = AM A为1*3的矩阵[x,y,1]B为1* 3的矩阵[x’,y’,1]M为3*3仿射矩阵 所以AM=B可以写成: 展开后得到: 以... 阅读全文
posted @ 2012-04-26 08:56 pengyingh 阅读(210) 评论(0) 推荐(0)

导航