相关疑难解决方法(0)

模糊图像的特定部分(矩形,圆形)?

我想模糊图像矩形或圆形.谷歌搜索后,我发现很容易模糊整个图像,但很难模糊图像的特定部分(矩形,圆形).怎么可能???

提前致谢

iphone objective-c ios

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

如何删除已删除的UIImage

嗨大家我正在尝试在我的PanGesture中使用图像擦除代码我正在使用下面的代码:

 UIImage * image  = [UIImage imageNamed:@"326d4fb72362a2e44659141cadfc4977.jpg"];
 holderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 235)];
 imgForeground = [[UIImageView alloc] initWithFrame:[holderView frame]];
 [imgForeground setImage:image];
 [holderView addSubview:imgForeground];


 UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
 [panRecognizer setMinimumNumberOfTouches:1];
 [panRecognizer setMaximumNumberOfTouches:1];
 [panRecognizer setDelegate:self];
 [holderView addGestureRecognizer:panRecognizer];
 [self.view addSubview:holderView];
Run Code Online (Sandbox Code Playgroud)

然后我在这里处理这个

 -(void)move:(id)sender {

    CGPoint currentPoint;
    if([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateBegan){

        lastPoint =  [sender locationInView:imgForeground];
        lastPoint.y -=20;
    }
    else{

        currentPoint = [sender locationInView:imgForeground];;
        currentPoint.y -=20;
    }


    UIGraphicsBeginImageContext(imgForeground.frame.size);
    [imgForeground.image drawInRect:CGRectMake(imgForeground.frame.origin.x, imgForeground.frame.origin.y, imgForeground.frame.size.width, imgForeground.frame.size.height)];

    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetLineCap(context,kCGLineCapRound); //kCGImageAlphaPremultipliedLast);
    CGContextSetLineWidth(context, 10); …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uiimageview uiimage ios

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

标签 统计

ios ×2

iphone ×2

objective-c ×2

uiimage ×1

uiimageview ×1