Ios 在父UIImage上方创建空心UIImage覆盖
我有以下代码在另一个UIImage层上创建一个UIImage层Ios 在父UIImage上方创建空心UIImage覆盖,ios,objective-c,image-processing,uiimage,overlay,Ios,Objective C,Image Processing,Uiimage,Overlay,我有以下代码在另一个UIImage层上创建一个UIImage层 顶层充当主层上某些对象的高亮显示 CIImage *overlay1 = [CIImage imageWithColor:[CIColor colorWithRed:1 green:0 blue:0 alpha:1.00f]]; overlay1 = [overlay1 imageByCroppingToRect:image.extent]; overlay1 = [overlay1 imageByApplyingFil
顶层充当主层上某些对象的高亮显示
CIImage *overlay1 = [CIImage imageWithColor:[CIColor colorWithRed:1 green:0 blue:0 alpha:1.00f]];
overlay1 = [overlay1 imageByCroppingToRect:image.extent];
overlay1 = [overlay1 imageByApplyingFilter:@"CIPerspectiveTransformWithExtent" withInputParameters:@{@"inputExtent":[CIVector vectorWithCGRect:image.extent],@"inputTopLeft":[CIVector vectorWithCGPoint:CGPointMake(topLeft.x - 5, topLeft.y + 5)],@"inputBottomRight":[CIVector vectorWithCGPoint:CGPointMake(bottomRight.x + 5, bottomRight.y)] }];
image = [overlay1 imageByCompositingOverImage:image];
其中,image是我的主层,overla1是次层。目前,第二层是一个充满红色的矩形荧光灯 这四个位置一直在变化,我每次都会重新绘制这个覆盖图 我想让它只是边框,而不是填充的覆盖层 我请求解决方案的过程与之前相同,因为我对iOS完全陌生,无法处理更多的更改 永远感谢帮助者