国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武宁县| 建湖县| 兰西县| 宝坻区| 陆河县| 克山县| 汉川市| 正安县| 景德镇市| 普洱| 江门市| 大城县| 自治县| 虹口区| 修水县| 乌海市| 阿克苏市| 东乡族自治县| 穆棱市| 郯城县| 云和县| 吴忠市| 罗定市| 象州县| 玛沁县| 扶沟县| 清新县| 滦平县| 泽普县| 宣汉县| 营口市| 青河县| 台山市| 阳山县| 山阴县| 邻水| 宜城市| 凤山县| 富平县| 双江| 塔城市|