我想在圆形的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