Tag: 模糊

模糊效果在iOS的视图

我想使用UIImagePicker来显示相机预览。 在这个预览中,我想用控件放置一个叠加视图。 是否可以将任何效果应用于从相机显示的预览? 我特别需要在相机预览中应用模糊效果。 所以我想从相机和覆盖视图控制模糊的预览。 如果我决定从相机捕捉静止图像,我需要它的原始没有模糊效果。 所以模糊效果只能应用于预览。 这是可能的使用这样的configuration,或者AVFoundation用于访问相机预览或其他方式,或者根本不可能?

文本模糊与UICOllectionview单元格

我有collectionView单元格中,我有这个文本,我想模糊图像中显示的文字。 我曾尝试使用UIVisualEffect,但我没有得到确切的答复。 代码: UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //Blur the UIImage with a CIFilter CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage]; CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"]; [gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"]; [gaussianBlurFilter setValue:[NSNumber numberWithFloat: 10] forKey: @"inputRadius"]; CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"]; UIImage *endImage = [[UIImage alloc] initWithCIImage:resultImage]; //Place the UIImage in […]

使用UIVisualEffectView创build一个模糊视图,在模拟器上正确,但不是在iPhone和iPad上

目标:在应用程序中创build模糊视图。 我使用的代码是: func createBlurBackgroundView() { if !UIAccessibilityIsReduceTransparencyEnabled() { if blurredSubView == nil || blurredSubView.superview == nil { print("Create blurred background view") self.backgroundColor = UIColor.clearColor() let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light) blurredSubView = UIVisualEffectView(effect: blurEffect) blurredSubView.frame = self.bounds self.insertSubview(blurredSubView, atIndex: 0) } } else { print("Transparency disabled!! no blur view") } } 结果是:在模拟器上的一切工作正常: 但是当我在iphone和ipad上运行它时,它看起来像: 请注意我没有改变“降低透明度”的设置! 那么当我想拍摄这个黑色的背景而不模糊的时候,你猜怎么着? 在照片stream中,我看到了正确的模糊视图图片… […]

xCode – UIVisualEffectViewanimation

animationVisualEffetView时遇到问题。 这里是我声明它的代码。 UIBlurEffect* blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; effectView = [[UIVisualEffectView alloc] initWithEffect:blur]; effectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; effectView.frame = self.bounds; self.layer.borderWidth = 1; [self addSubview:effectView]; 当animation超级景观,使其成长,视觉效果跟随superview的animation,但是当我想要减less它,视觉效果立即消失,使结果非常丑陋^^这里是我animationsuperview(这里叫recherche) [UIView animateWithDuration:0.3f delay:0.0f options:UIViewAnimationOptionTransitionNone animations:^{ CGRect f = recherche.frame; f.size.height = 0; [recherche setFrame:f]; } completion:^(BOOL finished){ [recherche removeFromSuperview]; recherche = nil; }]; 这就是我在做logging时消失的东西。 白色方块似乎是效果视图,因为如果我更改UIBlurEffectStyle,颜色会改变。 但模糊效果缺失x)

模糊效果在iOS 7.1上消失了

出于某种原因,模糊效果从iOS 7.1上的应用程序中消失了。 我在iOS 7.0.x的设备上运行相同的代码,另一个运行在7.1上。 以下是我所看到的: iOS 7.0.x iOS 7.1 可能是什么问题,以及如何解决这个问题? (显然我想保持模糊效果:)) 更新: 这是我设定的颜色: [UIColor colorWithRed:255.0f/255.0f green:201.0f/255.0f blue:0.0f/255.0f alpha:1.0]; 我从barTintColor属性中设置它

CIGaussianBlur图像大小

嘿想模糊我的看法,我用这个代码: //Get a UIImage from the UIView NSLog(@"blur capture"); UIGraphicsBeginImageContext(BlurContrainerView.frame.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //Blur the UIImage CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage]; CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"]; [gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"]; [gaussianBlurFilter setValue:[NSNumber numberWithFloat: 5] forKey: @"inputRadius"]; //change number to increase/decrease blur CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"]; //create UIImage from […]