topn3dpie.aspx

------------------

<%@Pagelanguage="c#"CodeBehind="topn3dpie.aspx.cs"AutoEventWireup="false"Inherits="Yeefly.topn3dpie"%>

topn3dpie.aspx.cs

-----------------

usingSystem;

usingSystem.Collections;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Web问答营销的特色";

usingSystem.Web.SessionState;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls络营销公司";

usingSystem.Web.UI.HtmlControls;

usingSystem.Drawing.Imaging;

usingSystem.Drawing.Drawing2D;

usingSystem.IO;

namespaceYeefly

{

///

///Graph的摘要阐明。

///

publicclasstopn3dpie:System.Web.UI.Page

{

privatevoidPage_Load(objectsender,System.EventArgse)

{

Response.ContentType="image/jpeg";

constintwidth=300,height=300;

intx=30,y=50;

intpieWidth=120,pieHeight=40,pieShadow=15;

int[]arrVote={70,90,80,20,60,40};

RandomoRan=newRandom();

BitmapobjBitmap=newBitmap(width,height);

GraphicsobjGraphics=Graphics.FromImage(objBitmap);

objGraphics.DrawRectangle(newPen(Color.Black),0,0,width,height);

objGraphics.FillRectangle(newSolidBrush(Color.White),1,1,width-2,height-2);

SolidBrushobjBrush=newSolidBrush(Color.Blue);

objGraphics.SmoothingMode=SmoothingMode.AntiAlias;

intiCurrentPos=0;

Color[]arrColor={Color.Red,Color.Red,Color.Red,Color.Red,Color.Red,Color.Red};

for(inti=arrVote.Length-1;i>=0;i--)

{

arrColor[i]=Color.FromArgb(oRan.Next(255),oRan.Next(255),oRan.Next(255))百科建造";

}

for(inti=arrVote.Length-1;i>=0;i--)

{

objBrush.Color=arrColor[i];

for(intiLoop2=0;iLoop2

objGraphics.FillPie(newHatchBrush(HatchStyle.Percent50,objBrush.Color),x股票900941,股票900941,股票900941,y+iLoop2,pieWidth,pieHeight,iCurrent创业板管理办法,创业板管理办法,创业板管理办法Pos,arrVote[i]);

iCurrentPos+=arrVote[i];

}

iCurrentPos=0;

for(inti=arrVote.Length-1;i>=0;i--)

{

objBrush.Color=arrColor[i];

objGraphics.FillPie(objBrush,x,y,pieWidth,pieHeight,iCurrentPos,arrVote[i]);

iCurrentPos+=arrVote[i];

}

objBitmap.Save(Response.OutputStream,ImageFormat.Jpeg);

//cleanup...

objGraphics.Dispose();

objBitmap.Dispose();

}

#regionWeb窗体规划器生成的代码

overrideprotectedvoidOnInit(EventArgse)

{

//

//CODEGEN:该调用是ASP.NETWeb窗体规划器所必需的。

//

InitializeComponent();

base.OnInit(e);

}

///

///规划器支撑所需的办法-不要运用代码编辑器修正

///此办法的内容。

///

privatevoidInitializeComponent()

{

this.Load+=newSystem.EventHandler(this.Page_Load);

}

#endregion

}

}

;

本文来自:软文ruanwen.tingclouds