iOS 图片合成和裁剪
来源:互联网 发布:纹身图库软件 编辑:程序博客网 时间:2024/05/09 15:21
- - (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {
- UIGraphicsBeginImageContext(image1.size);
- // Draw image1
- [image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)];
- // Draw image2
- [image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)];
- UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return resultingImage;
- }
- //裁剪
- - (UIImage*) combineImageFromCuttingScreen {
UIGraphicsBeginImageContext(self.baseImageView.frame.size);
UIGraphicsBeginImageContextWithOptions(self.combineView.frame.size, YES, 1);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetShouldAntialias(context, YES);
CGContextSetShouldSmoothFonts(UIGraphicsGetCurrentContext(),YES);
CGContextSaveGState(context);
CGRect r = CGRectMake(0, 0, 320, 392);
UIRectClip(r);
[self.combineView.layer renderInContext:context];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
0 0
- iOS 图片合成和裁剪
- iOS 图片处理-图片旋转和裁剪
- IOS图片裁剪和小图看大图动画
- IOS图片裁剪和小图看大图动画
- iOS图片裁剪和小图看大图动画
- Android图片合成/裁剪原理(转)
- IOS 图片合成
- ios图片的合成
- Android图片裁剪,合成(调用系统裁剪功能)
- iOS图片加工---图片水印,图片裁剪和屏幕截图
- C# 图片的裁剪,两个图片合成一个图片
- ios裁剪图片
- iOS 裁剪图片
- IOS 裁剪图片
- ios图片裁剪
- ios 代码裁剪图片
- IOS 裁剪图片
- iOS 图片裁剪 缩放
- C# Memory Management for Unity Developers
- HashMap的简单实现,具有线程安全
- 主程序
- 用选择法对10个整数按从小到大排序(数组)
- PullToRefresh使用详解
- iOS 图片合成和裁剪
- 767 因子和
- ios7之后的适配属性讲解edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars等
- 多播,组播
- hdu1016 Prime Ring Problem dfs 素数打表
- assets目录图片查看器
- 根据字体多少使UILabel自动调节尺寸
- 删除数据库出错
- Android学习笔记:超能RecyclerView组件使用总结