我有這個問題: 我有一個點的數組,我會用Quartz或類似的點繪製一個不規則的多邊形。 你能建議我做到這一點的最佳方法嗎?在iphone上繪製一個不規則的多邊形
MyTest的drawRect中是這樣的:
- (void)drawRect:(CGRect)rect
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClearRect(ctx, rect);
CGContextSetRGBStrokeColor(ctx, 255, 0, 255, 1);
CGPoint points[6] = { CGPointMake(100, 200), CGPointMake(150, 250),
CGPointMake(150, 250), CGPointMake(50, 250),
CGPointMake(50, 250), CGPointMake(100, 200) };
CGContextStrokeLineSegments(ctx, points, 6);
}
你能告訴我們你迄今爲止編寫的代碼? – 2012-03-21 09:44:43
我已添加我的測試代碼... – Safari 2012-03-21 10:12:52