欢迎光临
我们一直在努力

C# 绘图–飘带-.NET教程,C#语言

建站超值云服务器,限时71元/月

c# 绘图–飘带

杨贺宏

//————————————-

// drawstreamer.cs by flycrane

//————————————-

using system;

using system.drawing;

using system.windows.forms;

class drawstreamer : form

{

publicstaticvoidmain()

{

application.run( new drawstreamer() );

}

public drawstreamer()

{

text= "飘带图案-flycrane";

backcolor= color.aliceblue;

forecolor= color.gold;

resizeredraw= true;

width= 600;

height= 350;

}

protectedoverridevoid onpaint(painteventargs e)

{

graphics mygraphics= e.graphics;

pen mypen= new pen( forecolor,2 );

// center of the circle.

float originx=clientsize.width/2;

float originy=clientsize.height;

float x1,x2,y1;

// draw streamer,which comprise series of horizontal line segment;

for ( double a=0;a<=math.pi ;a+=math.pi/380 )

{

x1 =(float) ( 280*math.cos( 1.6*a ) +originx );

y1 =(float) ( 479-( ( 90*math.sin( 8*a ) )*math.cos( a/2.5 )+originy ) );

x2 =(float) ( 280*math.cos( 1.8*a )+originx );

mygraphics.drawline ( mypen,x1,y1,x2,y1);

}

}

}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » C# 绘图–飘带-.NET教程,C#语言
分享到: 更多 (0)

相关推荐

  • 暂无文章