当前位置: 首页 > news >正文

图片合成

  

   UIImageView *imageBigger = [[UIImageView alloc] init];

    imageBigger.backgroundColor = [UIColor clearColor]; // 背景色设置为透明

    imageBigger.layer.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0].CGColor;

    imageBigger.frame = self.view.bounds;

    

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)];

    imageView.image = [UIImage imageNamed:@"hb"];

    imageView.backgroundColor = [UIColor clearColor];

    imageView.layer.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0].CGColor;

    [imageBigger addSubview:imageView];

    

    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(200, 200, 400, 400)];

    imageView1.image = [UIImage imageNamed:@"hb"];

    imageView1.backgroundColor = [UIColor clearColor];

    imageView1.layer.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0].CGColor;

    [imageBigger addSubview:imageView1];

    

    UIGraphicsBeginImageContextWithOptions(imageBigger.bounds.size, NO, 0.0);

    [imageBigger.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *resultingImage=UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

 

 

  

转载于:https://www.cnblogs.com/z-z-z/p/9625750.html

相关文章:

  • 对象 get和set方法
  • spsss基本统计分析操作攻略
  • liunx环境下mongodb3.2升级至3.6
  • Keil MDK下如何设置非零初始化变量(复位后变量值不丢失)
  • web服务器下出现大量TIME_WAIT
  • 正则 常见2
  • js限制文本框只能输入数字方法小结
  • VC++文件操作之最全篇
  • SDN控制器列表
  • jdbc学习
  • [HNOI2006]鬼谷子的钱袋
  • ES6装饰器Decorator基本用法
  • 章节六、3-读取Properties属性文件
  • Qt读写ini文件
  • js的Date.parse()方法和getTime()的坑
  • [译]前端离线指南(上)
  • bootstrap创建登录注册页面
  • ComponentOne 2017 V2版本正式发布
  • es6
  • IndexedDB
  • Java的Interrupt与线程中断
  • Octave 入门
  • supervisor 永不挂掉的进程 安装以及使用
  • thinkphp5.1 easywechat4 微信第三方开放平台
  • 给新手的新浪微博 SDK 集成教程【一】
  • 今年的LC3大会没了?
  • 跨域
  • 如何用vue打造一个移动端音乐播放器
  • 设计模式(12)迭代器模式(讲解+应用)
  • 深度学习在携程攻略社区的应用
  • 我是如何设计 Upload 上传组件的
  • 一些css基础学习笔记
  • 一些关于Rust在2019年的思考
  • 用Canvas画一棵二叉树
  • ionic入门之数据绑定显示-1
  • Mac 上flink的安装与启动
  • Spring第一个helloWorld
  • ​ 轻量应用服务器:亚马逊云科技打造全球领先的云计算解决方案
  • ###STL(标准模板库)
  • #Z0458. 树的中心2
  • (5)STL算法之复制
  • (附源码)基于SpringBoot和Vue的厨到家服务平台的设计与实现 毕业设计 063133
  • (简单有案例)前端实现主题切换、动态换肤的两种简单方式
  • (免费领源码)Java#ssm#MySQL 创意商城03663-计算机毕业设计项目选题推荐
  • (免费领源码)python+django+mysql线上兼职平台系统83320-计算机毕业设计项目选题推荐
  • (三)Pytorch快速搭建卷积神经网络模型实现手写数字识别(代码+详细注解)
  • (顺序)容器的好伴侣 --- 容器适配器
  • (转) 深度模型优化性能 调参
  • (转)从零实现3D图像引擎:(8)参数化直线与3D平面函数库
  • (转载)hibernate缓存
  • .net core 微服务_.NET Core 3.0中用 Code-First 方式创建 gRPC 服务与客户端
  • .Net mvc总结
  • .net 前台table如何加一列下拉框_如何用Word编辑参考文献
  • .NET牛人应该知道些什么(2):中级.NET开发人员
  • .NET企业级应用架构设计系列之应用服务器