C # drawing--Streamers

Source: Internet
Author: User
Tags cos
C # drawing--Streamers

Yang Heohong


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

DrawStreamer.cs by Flycrane

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



Using System;



Using System.Drawing;



Using System.Windows.Forms;






Class Drawstreamer:form



{



Publicstaticvoidmain ()



{



Application.Run (New Drawstreamer ());



}



Public Drawstreamer ()



{



text= "streamer pattern-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);

}







}



}





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.