国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

C# 繪圖--金剛石

2024-07-21 02:19:07
字體:
來源:轉載
供稿:網友

c# 繪圖--金剛石

楊賀宏


//-------------------------------------

// drawdiamond.cs by flycrane

//-------------------------------------

using system;

using system.drawing;

using system.windows.forms;



class drawdiamond : form

{

publicstaticvoidmain()

{

application.run( new drawdiamond() );

}

public drawdiamond()

{

text= "金剛石圖案-flycrane";

backcolor= color.black;

forecolor= color.white;

resizeredraw= true;

width= 400;

height= 400;

}



protectedoverridevoid onpaint(painteventargs e)

{

graphics mygraphics= e.graphics;

pen mypen= new pen( forecolor,2 );



float radius= (float) ( width/2.2 );

constint partitionnum= 25;

float angleunit= (float) ( 2*math.pi/partitionnum );



float[] circlex= newfloat[partitionnum];

float[] circley= newfloat[partitionnum];



// center of the circle.

float originx=clientsize.width/2;

float originy=clientsize.height/2;



//store coordinates of the nodes on the circle verge.

for ( int i=0;i<partitionnum;i++ )

{

circlex[i]= (float) ( radius*math.cos( i*angleunit ) ) + originx;

circley[i]= (float) ( radius*math.sin( i*angleunit ) ) + originy;

}



//link nodes on the circle verge.

for ( int i=0;i<=partitionnum-2;i++ )

{

for ( int j=i+1;j<=partitionnum-1;j++ )

mygraphics.drawline( mypen,circlex[i],circley[i],circlex[j],circley[j] );

}

}

}

,歡迎訪問網頁設計愛好者web開發。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滕州市| 枣强县| 泗洪县| 永和县| 邵阳县| 集安市| 平山县| 罗江县| 荆州市| 连山| 山东省| 中阳县| 博客| 特克斯县| 石景山区| 黑山县| 中超| 炎陵县| 邢台市| 蓝田县| 太康县| 阜城县| 泗水县| 石泉县| 沁阳市| 奎屯市| 齐齐哈尔市| 虎林市| 福鼎市| 天等县| 贡嘎县| 宁南县| 华容县| 石楼县| 北流市| 辽阳市| 嘉善县| 治县。| 宜兰县| 怀远县| 巴东县|