1
A
回答
3
是的。我建議你閱讀你自己提供的手冊條目,因爲它告訴你你需要做什麼。它甚至給出了一個3點明星的例子,甚至有一個5面明星用戶註釋中的例子。
2
這很容易計算出你需要的點:
<?php
function drawStar($img,$x,$y,$radius,$sides,$color,$spikness=0.5)
{
$point =array();
$t = 0;
for($a = 0;$a <= 360;$a += 360/($sides*2))
{
$t++;
if($t % 2 == 0)
{
$point[] = $x + ($radius * $spikness) * cos(deg2rad($a));
$point[] = $y + ($radius * $spikness) * sin(deg2rad($a));
}else{
$point[] = $x + $radius * cos(deg2rad($a));
$point[] = $y + $radius * sin(deg2rad($a));
}
}
return imagefilledpolygon($img,$point,$sides*2,$color);
}
?>
相關問題
- 1. OpenGl明星繪圖
- 2. Java:繪製明星和連接點與繪圖面板
- 3. 高效地繪製星圖
- 4. 在Image-Box中繪製明星
- 5. Android和繪畫明星圖片
- 6. 繪製的星
- 7. Java:繪製「隨機」星星
- 8. 繪製透明圖像
- 9. 繪製透明圖像
- 10. 星座繪圖
- 11. 用半透明視圖繪製陰影
- 12. Python的繪製龜圖正五角星
- 13. 繪製透明NSImage中使得透明
- 14. 使用matplotlib繪製3d圖,draw()需要附加參數
- 15. 如何繪製像使用CGContextClearRect繪製透明矩形的透明圓形
- 16. 使用透明度繪製矩形
- 17. 使用gnuplot繪製透明3D盒子
- 18. 如何使用GDI繪製透明BMP +
- 19. 使用Tensorflow繪製圖形
- 20. 使用CGImage繪製圖像?
- 21. 使用graphviz繪製樹圖
- 22. 使用'filled.contour'繪製地圖
- 23. 使用OpenStreetMap繪製地圖
- 24. 繪製圖形使用matplotlib
- 25. 使用highchart.js繪製圖表
- 26. 使用CorePlot繪製餅圖
- 27. 使用LGPL繪製二維繪圖庫
- 28. drawBitmap使用透明位圖繪製,替換原始像素
- 29. 如何使用System.Drawing繪製透明圖像?
- 30. 如何使用透明度繪製PNG圖像輪廓(邊框)
如果將這些點繪製? - 這實際上是一個數學問題。你有沒有碰巧在學校學習? – 2010-08-22 04:45:14
是的,我真的想知道的是數學公式... – 2010-08-22 17:06:02
不錯的例子在這裏http://www.riccardostecca.net/1/?p=37 – SteakOverflow 2015-02-26 14:57:17