【问题标题】:iphone image mergingiphone图像合并
【发布时间】:2011-08-21 00:07:49
【问题描述】:

我想通过单击按钮将多个图像合并为一个图像>我的问题是,如果用户在 tableview 中触摸图像,则相应的图像必须与下一页中的主图像合并..如何我们可以这样做吗?

这是页面中的主图!this the the uppercloth

我必须修复漫画中的上布

【问题讨论】:

    标签: ios image cocoa-touch


    【解决方案1】:

    使用 UIGraphicsBeginImageContext,然后调用图像的 drawAtPoint 方法,然后使用 UIGraphicsGetImageFromCurrentImageContext 获取合并后的图像。像这样的东西(没有检查,只是从内存中写的..可能有语法错误..纠正自己..)

    UIGraphicsBeginImageContext(yourFirstImage.size);
    [yourFirstImage drawAtPoint:CGPointMake(0,0)];
    [yourSecondImage drawAtPoint:CGPointMake(0,0)];
    
    UIImage *mergedImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    

    【讨论】:

    • ,thnku,另一个疑问,我想在这个视图的子视图中创建按钮,如果我点击子视图中的按钮,视图的图像会发生变化吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-13
    • 2011-07-28
    • 2015-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多