嘿,当我将过滤器应用于图像时,CISoftLightBlendMode 出现问题,叠加图像不在另一个图像的中心,它只是停留在左下角,因此只有很小一部分图像被叠加覆盖质地。
这是我的代码:
UIImage* bg = [UIImage imageNamed:@"Texture.png"];
CIImage* beginImage = [CIImage imageWithCGImage:[image_view.image CGImage]];
CIImage* bgImage = [CIImage imageWithCGImage:bg.CGImage];
context = [CIContext contextWithOptions:nil];
filter = [CIFilter filterWithName:@"CISoftLightBlendMode" keysAndValues: kCIInputImageKey, beginImage,@"inputBackgroundImage",bgImage, nil];
CIImage *outputImage = [filter outputImage];
CGImageRef cgimg = [context createCGImage:outputImage fromRect:[outputImage extent]];
UIImage *newImg = [UIImage imageWithCGImage:cgimg];
[Image_View setImage:newImg];