2011-12-26 14 views
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(); 

答えて

0

あなたはあなたのタッチでこの

http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html

を行うためにマスクを使用することができますが欲しい何のイベントが

のみ黒と白のマスク画像を描画移動し

+0

元の画像をマスクしますイベントが発生しましたtouchesMovedピクセルを取得して透明にすることができます。私は背景ビューを表示することができます。 – sarak

関連する問題