0
私はすでにkCGBlendModeXORを試しましたが、透過後は黒くなります。iPhone:TouchesMovedイベントで透明なイメージを作成するには?
ここで私のコードは私が行ったが、それは私が望むものではない。
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:self.view];
CGPoint lastPoint = [touch locationInView: [UIApplication sharedApplication].keyWindow];
UIGraphicsBeginImageContext(self.view.frame.size);
CGRect rect = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
[imageView_skype.image drawInRect:rect];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineWidth(context, 36.0);
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextSetAlpha(context,0.10);
CGContextSetBlendMode(context, kCGBlendModeXOR);
CGContextBeginPath(context);
CGContextMoveToPoint(context, lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(context, currentPoint.x, currentPoint.y);
CGContextStrokePath(context);
imageView_skype.image = UIGraphicsGetImageFromCurrentImageContext();
元の画像をマスクしますイベントが発生しましたtouchesMovedピクセルを取得して透明にすることができます。私は背景ビューを表示することができます。 – sarak