嗨,有沒有什麼辦法可以用按鈕以編程方式更改顏色?在uidraw中更改顏色更改
>
-(void)drawToBuffer {
// Red Gr Blu Alpha
CGFloat color[4] = {0.0, 0.0, 0.0, 1.0};
if (self.previousPoint != nil) {
CGContextSetRGBStrokeColor(offScreenBuffer, color[0], color[1], color[2], color[3]);
CGContextBeginPath(offScreenBuffer);
CGContextSetLineWidth(offScreenBuffer, 5.0);
CGContextSetLineCap(offScreenBuffer, kCGLineCapRound);
CGContextMoveToPoint(offScreenBuffer, previousPoint.location.x, previousPoint.location.y);
CGContextAddLineToPoint(offScreenBuffer, point.location.x, point.location.y);
CGContextDrawPath(offScreenBuffer, kCGPathStroke);
}
}
這屬於uidraw視圖和IM希望在我的應用程序
它現在黑色我想把它改成白色,所以它會像橡皮擦 – Freedom4ever