cocos2d里面的文理图片和UIImage之间的转化
来源:互联网 发布:linux grub启动命令 编辑:程序博客网 时间:2024/06/05 12:39
///////////////////////////UI控件和cocos2dtexture之间转换/////////////////////////////////////////////////////////////////////////////////
+(UIImage *) convertSpriteToImage:(CCSprite *)sprite
{
CGPoint p = sprite.anchorPoint;
[sprite setAnchorPoint:ccp(0,0)];
CCRenderTexture *renderer = [CCRenderTexturerenderTextureWithWidth:sprite.contentSize.widthheight:sprite.contentSize.height];
[renderer begin];
[sprite visit];
[renderer end];
[sprite setAnchorPoint:p];
return [renderer getUIImage];
}
+(CCSprite *) convertImageToSprite:(UIImage *) image
{
CGImageRef cgimage=image .CGImage;
CCTexture2D *texture = [[CCTexture2Dalloc] initWithCGImage:cgimage resolutionType:kCCResolutioniPadRetinaDisplay];
CCSprite *sprite = [CCSprite spriteWithTexture:texture];
[texture release];
return sprite;
}
- cocos2d里面的文理图片和UIImage之间的转化
- (ios)UIImage,CGImage和CGImageRef之间的转化
- NSData、 UIImage、ALAsset之间的关系和转化
- UIImage 和 NSData 的转化
- Base64图片与UIImage的相互转化
- Base64图片与UIImage的相互转化
- Base64图片与UIImage的相互转化
- iOS UIImage 和 NSString的相互转化
- iOS Base64图片与UIImage的相互转化
- NSData和UIImage之间的转换
- UIImage和IplImage之间的相互转换
- UIImage和UIColor之间的转变
- UIImage 和 NSData 之间的转换
- UIImage 和 NSString 之间的互转
- NSData和UIImage之间的转换
- UIImage和Base64格式图片相互转化!
- html5中svg,canvas和图片之间的相互转化
- 画图至 UIImage ,而后再在 drawRect 里面,贴上UIImage,图片模糊的问题
- ASP.NET MVC中Area分层模块处理大解密 下
- 【Java基础 009】 正则表达式
- android下res目录 资源定义及使用
- MySql常用命令总结(转)
- eclipse 添加 外部 jar包 方法
- cocos2d里面的文理图片和UIImage之间的转化
- ZOJ 1073 Round and Round We Go
- 中国Android手机top5排名 三星仍居第一
- 千淘万漉虽辛苦,吹尽狂沙始见金
- 函数与字符串的相互转化,@selecte函数转化为字符串传递,字符串转化为@select接收
- 一个有意思的VMP破解 旺旺吧上网经营管理系统 破解
- C语言实现半角、全角字符转换
- STM32 Printf函数实现方法
- QUnit 入门