Fork me on GitHub

2012年4月28日

摘要: NSURL *url = [NSURLURLWithString:[GameData.login_info.logostringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];NSData *data = [NSDatadataWithContentsOfURL:url];CFDataRef imgData = (CFDataRef)data;CGDataProviderRef imgDataProvider = CGDataProviderCreateWithCFData (imgData);CGImageRef imag 阅读全文
posted @ 2012-04-28 17:22 pengyingh 阅读(134) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/aurora_mylove/article/details/1700540混合是什么呢?混合就是把两种颜色混在一起。具体一点,就是把某一像素位置原来的颜色和将要画上去的颜色,通过某种方式混在一起,从而实现特殊的效果。假设我们需要绘制这样一个场景:透过红色的玻璃去看绿色的物体,那么可以先绘制绿色的物体,再绘制红色玻璃。在绘制红色玻璃的时候,利用“混合”功能,把将要绘制上去的红色和原来的绿色进行混合,于是得到一种新的颜色,看上去就好像玻璃是半透明的。要使用OpenGL的混合功能,只需要调用:glEnable(GL_BLEND);即可。要关闭OpenGL的混 阅读全文
posted @ 2012-04-28 14:10 pengyingh 阅读(188) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/2271492/objective-c-equivalent-of-java-vectorask:What is the equivalent for Vector's of Java in Objective-C?answer:Try using NSMutableArray.The closest thing you will find is NSMutableArray, execpt that contrary to java Vector, it is not thread safe. If you do 阅读全文
posted @ 2012-04-28 12:41 pengyingh 阅读(1180) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/wasd6081058/article/details/7216266在Linux系统里,/usr/include/linux/if_pppox.h里面有这样一个结构:struct pppoe_tag { __u16 tag_type; __u16 tag_len; char tag_data[0];} __attribute ((packed));最后一个成员为可变长的数组,对于TLV(Type-Length-Value)形式的结构,或者其他需要变长度的结构体,用这种方式定义最好。使用起来非常方便,创建时,malloc一段结构体大小加上可变长数... 阅读全文
posted @ 2012-04-28 12:34 pengyingh 阅读(455) 评论(0) 推荐(0)
摘要: http://www.haogongju.net/art/904112Core Animation: Creating a Jack-in-the-box with CAKeyframeAnimationA previous example demonstrated how CAKeyframeAnimation canmove layers along a CGPath, but CAKeyframeAnimation can also move a layer through a succession of points with a custom timing for each poin 阅读全文
posted @ 2012-04-28 09:49 pengyingh 阅读(835) 评论(0) 推荐(0)

导航