小编ben*_*ore的帖子

当我的手指移动时,如何填充图像的透明区域

我想用画笔绘制透明区域,但我的代码工作得不是很好.我想有人可以帮助我.我的代码:

// Handles the start of a touch

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    CGRect bounds = [self bounds];
    UITouch *touch = [[event touchesForView:self] anyObject];

    if (![image isPointTransparent:[touch locationInView:self]]
       || ![image isPointTransparent:[touch previousLocationInView:self]]) 
    {
        return;
    }

firstTouch = YES;

    // Convert touch point from UIView referential to OpenGL one (upside-down flip)

location = [touch locationInView:self];
location.y = bounds.size.height - location.y;
}

// Handles the continuation of a touch.

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{  
    CGRect bounds = [self bounds];
    UITouch …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uiimageview brushes ios

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

标签 统计

brushes ×1

ios ×1

iphone ×1

objective-c ×1

uiimageview ×1