0
A
回答
0
在UIView的子視圖您-drawRect方法:
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(ctx, point1.x, point1.y);
CGContextAddLineToPoint(ctx, point2.x, point2.y);
CGContextAddLineToPoint(ctx, point3.x, point3.y);
CGContextAddLineToPoint(ctx, point1.x, point1.y);
CGContextClosePath(context);
CGContextStrokePath(ctx);
相關問題
- 1. CGPointMake in Swift
- 2. 隨機CGPointMake?
- 3. CGPointMake不能在viewDidLoad
- 4. 當CGPointMake遇到大數字
- 5. 將變量設置爲CGPointMake
- 6. 繪圖使用ExtendScript
- 7. 使用cocos2d繪圖
- 8. 使用UIGraphics繪圖
- 9. 使用OpenGL繪圖
- 10. 繪圖使用python
- 11. 使用CoreGraphics繪圖
- 12. 繪圖使用JApplets
- 13. 繪圖使用PIL
- 14. 使用glDrawArray繪圖
- 15. 繪圖使用QPainter
- 16. 使用libcairo繪圖
- 17. 繪圖使用Canvas
- 18. 使用Python繪圖
- 19. 使用.NET繪圖
- 20. 使用Tkinter繪圖
- 21. 使用gnuplot繪圖圖形
- 22. 使用LGPL繪製二維繪圖庫
- 23. 使用繪圖儀繪製圓形
- 24. 問題分配遞增值到CGPointMake
- 25. Cocos2d:ccp和CGPointMake之間的區別?
- 26. iOS:錯誤的影響與「Recognizer.view.center = CGPointMake(...」
- 27. ios CGPointMake error - 致命異常NSRangeException
- 28. CGPointMake(隨機(),隨機())不工作
- 29. 可可觸摸 - 緩慢移動CGPointMake
- 30. 繪製圖形使用matplotlib
如果我不希望這樣做在的drawRect什麼? – aherlambang 2012-08-01 21:17:36
如果你想在別處做 - 你將不得不提供有效的CGContext參考 – 2012-08-01 21:58:53