http://www.chinabs.net/aspnet/default.asp?infoid=37

解决方案 »

  1.   

    用System.Drawing命名空间下的相应类来完成,做这么几个数字图片实在太容易了!--------------------------------
    AspNetPager 免费分页控件4.1版发布,欢迎下载使用:http://www.webdiyer.com
      

  2.   

    chinchyServer.MapPath("/")这个是什么东西啊?说是找不到名字空间,或者没有引用,晕~~哪里来的啊?
      

  3.   

    衷心感谢chinchy的帮助,问题已经解决,但是那个图片我嵌入到一个aspx页面中后,如果我不按F5键的话,就不会刷新,比如通过链接点过去,就怎么也不会刷新~~~该怎么解决啊?
      

  4.   

    Dim objBitmap As Bitmap
            Dim objGraphics As Graphics        Dim param As DrawParam = ParseParam()        ' param = ParseParam()
            Dim width As Integer = param.Width
            Dim sweep As Single = 0.0F
            Dim offSet As Single        objBitmap = New Bitmap(width, width)
            objGraphics = Graphics.FromImage(objBitmap)
            objGraphics.CompositingQuality = CompositingQuality.HighQuality
            objGraphics.FillRectangle(New SolidBrush(Color.White), 0, 0, width, width)        Dim p As Part
            For Each p In param.Parts            sweep = p.Percent * 360.0 / 100.0
                objGraphics.FillPie(New SolidBrush(p.ForeColor), New Rectangle(0, 0, width, width), offSet, sweep)            Dim textY As Single = 1 / 2 * width + 1 / 3 * width * (Math.Sin((offSet + sweep / 2) * Math.PI / 180))
                Dim textX As Single = 1 / 2 * width + 1 / 3 * width * (Math.Cos((offSet + sweep / 2) * Math.PI / 180))
                objGraphics.TranslateTransform(textX, textY)
                objGraphics.DrawString(p.Text, New Font("宋体", 12), New SolidBrush(Color.Red), 0, 0)
                objGraphics.Save()
                objGraphics.ResetTransform()
                offSet += sweep
            Next
            objBitmap.Save(Response.OutputStream, ImageFormat.Gif)        objBitmap.Dispose()
            objGraphics.Dispose()        Me.Response.ContentType = "image/gif"
      

  5.   

    以上我写的chart的代码片段,在page_load中执行,关键是这句:
    objBitmap.Save(Response.OutputStream, ImageFormat.Gif)