小编Sat*_*zad的帖子

如何在iPhone SDK中的Objective-C中合并两个UIImage对象

我正在开发一个iPhone应用程序,我想合并两个UIImages(leftImage和rightImage).任何人都可以建议如何做到这一点,而他们之间没有线条?

我目前正在这样做:

- (UIImage*)mergeImage:(UIImage*)first withImage:(UIImage*)second
{
    // get size of the first image
    CGImageRef firstImageRef = first.CGImage;
    CGFloat firstWidth = CGImageGetWidth(firstImageRef);
    CGFloat firstHeight = CGImageGetHeight(firstImageRef);

    // get size of the second image
    CGImageRef secondImageRef = second.CGImage;
    CGFloat secondWidth = CGImageGetWidth(secondImageRef);
    CGFloat secondHeight = CGImageGetHeight(secondImageRef);

    // build merged size
    CGSize mergedSize = CGSizeMake((firstWidth+secondWidth), MAX(firstHeight, secondHeight));

    // capture image context ref
    UIGraphicsBeginImageContext(mergedSize);

    //Draw images onto the context
    [first drawInRect:CGRectMake(0, 0, firstWidth, firstHeight)];
    //[second drawInRect:CGRectMake(firstWidth, 0, secondWidth, secondHeight)];
    [second drawInRect:CGRectMake(firstWidth, 0, secondWidth, secondHeight) …
Run Code Online (Sandbox Code Playgroud)

merge objective-c uiimage ios

5
推荐指数
1
解决办法
2769
查看次数

如何模糊UIImage,但保留锐利的物体边界?

我想对UIImage执行"智能"模糊,其中内容模糊,但边缘仍然清晰.

例如,这是我的原始图像:

锐利的原始图像

以下是应用此模糊后我想看到的内容:

模糊的图像

如何在UIImage上做这样的"智能"模糊?

iphone image-processing uiimage ios

1
推荐指数
1
解决办法
809
查看次数

标签 统计

ios ×2

uiimage ×2

image-processing ×1

iphone ×1

merge ×1

objective-c ×1