人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

Asp.Net 運(yùn)用 GDI+ 繪制3D餅圖基礎(chǔ)篇源碼

Asp.Net 運(yùn)用 GDI+ 繪制3D餅圖基礎(chǔ)篇源碼

更新時(shí)間:2022-08-02 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

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

topn3dpie.aspx.cs
-----------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.IO;

namespace Yeefly
{
 /// <summary>
 /// Graph 的摘要說明。
 /// </summary>
 public class topn3dpie : System.Web.UI.Page
 {
  private void Page_Load(object sender, System.EventArgs e)
  {
   Response.ContentType = "image/jpeg";
   const int width = 300, height = 300;
   int x = 30, y = 50;

   int pieWidth = 120, pieHeight = 40, pieShadow = 15;
   int[] arrVote = {70,90,80,20,60,40};
   Random oRan = new Random();
 

   Bitmap objBitmap = new Bitmap(width, height);
   Graphics objGraphics = Graphics.FromImage(objBitmap);
   objGraphics.DrawRectangle(new Pen(Color.Black),0,0,width,height);
   objGraphics.FillRectangle(new SolidBrush(Color.White), 1, 1,width - 2, height - 2);
   SolidBrush objBrush = new SolidBrush(Color.Blue);
   objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
 
   int iCurrentPos   = 0;

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

   for(int i = arrVote.Length - 1 ; i >= 0; i--)
   {
    arrColor[i] = Color.FromArgb(oRan.Next(255), oRan.Next(255), oRan.Next(255));
   }

   for(int i = arrVote.Length - 1 ; i >= 0; i--)
   {
    objBrush.Color = arrColor[i];
    for(int iLoop2 = 0; iLoop2 < pieShadow; iLoop2++)
     objGraphics.FillPie(new HatchBrush(HatchStyle.Percent50,objBrush.Color),x, y + iLoop2, pieWidth, pieHeight, iCurrentPos, arrVote[i]);
    iCurrentPos += arrVote[i];
   }

   iCurrentPos  = 0;
   for(int i = 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);
   // clean up...
   objGraphics.Dispose();
   objBitmap.Dispose();
  }

  #region Web 窗體設(shè)計(jì)器生成的代碼
  override protected void OnInit(EventArgs e)
  {
   //
   // CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設(shè)計(jì)器所必需的。
   //
   InitializeComponent();
   base.OnInit(e);
  }
 
  /// <summary>
  /// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內(nèi)容。
  /// </summary>
  private void InitializeComponent()
  {   
   this.Load += new System.EventHandler(this.Page_Load);
  }
  #endregion
 }
}

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 清远市| 田林县| 登封市| 兴宁市| 精河县| 磴口县| 香河县| 界首市| 衡南县| 阳信县| 建平县| 津南区| 绵阳市| 岳阳县| 时尚| 宣汉县| 大关县| 乐平市| 庆安县| 师宗县| 库伦旗| 宜春市| 丹凤县| 鹤峰县| 昌吉市| 和林格尔县| 江源县| 嘉祥县| 屏东市| 磐石市| 湄潭县| 乌兰县| 永登县| 高陵县| 大关县| 北流市| 西青区| 城市| 威信县| 邵武市| 建平县|