我想在圓形的zick-zack中畫一顆鑽石。請任何人幫助我。如何在ios中繪製鑽石和zick zack形狀?
-1
A
回答
4
我有平局鑽石Thish代碼使用來繪製鑽石
INT MGX = penThickness * 6; int mgY = penThickness * 2;
CGPoint st = CGPointMake(MIN(startingPt.x, endingPt.x), MIN(startingPt.y, endingPt.y));
CGPoint et = CGPointMake(MAX(startingPt.x, endingPt.x), MAX(startingPt.y, endingPt.y));
CGRect outsideRect = CGRectMake(st.x,st.y, MAX(mgX, et.x-st.x), MAX(mgY, et.y-st.y));
CGRect insideRect = CGRectInset(outsideRect, outsideRect.size.width * 0.30f, outsideRect.size.height * 0.30f);
CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(insideRect), CGRectGetMinY(outsideRect));
//0 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(insideRect), CGRectGetMinY(outsideRect));
//1 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(outsideRect), CGRectGetMidY(insideRect));
//2 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(insideRect), CGRectGetMaxY(outsideRect));
//3 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMinX(insideRect), CGRectGetMaxY(outsideRect));
//4 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMinX(outsideRect), CGRectGetMidY(insideRect));
CGPathCloseSubpath(pathRef);
1
4
我有結束於繪圖複合劑在Hexagone的thish代碼在拉伸加工Haxagon
INT MGX = penThickness * 6; int mgY = penThickness * 6;
CGPoint st = CGPointMake(MIN(startingPt.x, endingPt.x), MIN(startingPt.y, endingPt.y));
CGPoint et = CGPointMake(MAX(startingPt.x, endingPt.x), MAX(startingPt.y, endingPt.y));
CGRect outsideRect = CGRectMake(st.x,st.y, MAX(mgX, et.x-st.x), MAX(mgY, et.y-st.y));
CGRect insideRect = CGRectInset(outsideRect, outsideRect.size.width * 0.30f, outsideRect.size.height * 0.30f);
CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(insideRect), CGRectGetMinY(outsideRect));
//0 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(insideRect), CGRectGetMinY(outsideRect));
//1 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(outsideRect), CGRectGetMidY(insideRect));
//2 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(insideRect), CGRectGetMaxY(outsideRect));
//3 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMinX(insideRect), CGRectGetMaxY(outsideRect));
//4 line
CGPathAddLineToPoint(pathRef, nil, CGRectGetMinX(outsideRect), CGRectGetMidY(insideRect));
CGPathCloseSubpath(pathRef);
相關問題
- 1. 如何在iOS中以鑽石形狀顯示圖像?
- 2. IOS石英二維線連接和鑽石形狀
- 3. 如何繪製帶星號的鑽石
- 4. While循環繪製鑽石
- 5. 鑽石形狀視圖
- 6. PHP - 繪製成鑽石
- 7. 鑽石形狀的三角形圖像
- 8. 如何使用graphiti製作鑽石形狀?
- 9. 如何在iOS中繪製梯形形狀?
- 10. 在UIImageView中繪製形狀IOS
- 11. 如何在JFreechart中爲點獲取鑽石形狀
- 12. 控制檯中的鑽石繪圖
- 13. 鑽石形狀的打印數字PHP
- 14. Fortran 90陣列 - 鑽石形狀
- 15. 如何在形狀中繪製shapens?
- 16. 如何在SVG中繪製此形狀?
- 17. 如何在MKMapView中繪製形狀?
- 18. 如何在JPanel中繪製形狀?
- 19. 如何在Android中繪製形狀
- 20. 如何在爪哇形成鑽石
- 21. 如何繪製形狀
- 22. 在XAML中繪製形狀?
- 23. 如何使用iOS Quartz 2D繪圖繪製複雜的形狀?
- 24. 如何防止鑽石形狀的問號出現?
- 25. 在iOS中繪製矩形
- 26. 不能在C中獲得鑽石形狀
- 27. iOS多次繪製相同的形狀
- 28. R繪製鑽石並調整其寬度和高度
- 29. 如何在C中使用鼠標繪製和移動形狀#
- 30. 如何使用掛毯組件來繪製鑽石t:loop