asp.net

位置:IT落伍者 >> asp.net >> 浏览文章

ASP.NET 绘图


发布日期:2018年01月26日
 
ASP.NET 绘图

private void DrawPic(int[] arr int n string heroname)

{ Bitmap bitmap = new Bitmap( Graphics graphics

graphics = GraphicsFromImage(bitmap)

graphicsClear(ColorWhite)

graphicsDrawRectangle(PensBlack

graphicsDrawString(heroname + 英雄分布 new Font(宋体 FontStyleBold) BrushesBlack new PointF())

//最大的值

int max_value = arr[]int total_value = arr[]

graphicsDrawString(总样本点个数 + total_valueToString() new Font(宋体 FontStyleBold) BrushesBlue

//纵坐标标识

int step = if (max_value >

{ step = max_value / } else { step = } for (int i = i <= ++i)

{ graphicsDrawLine(new Pen(ColorBlue * i * i)graphicsDrawString((step * i)ToString() new Font(宋体 BrushesBlack * i)}

graphicsDrawString(玩家数 new Font(宋体 BrushesBlack

//横坐标标识

for (int i = i <= ++i)

{ graphicsDrawLine(new Pen(ColorBlue + * i + * i graphicsDrawString(( * i)ToString() new Font(宋体 BrushesBlack + * i }

graphicsDrawString(水平值 new Font(宋体 BrushesBlack

//柱状图(线)

for (int i = i < ++i)

{ if (arr[i] !=

{ graphicsDrawLine(new Pen(ColorRed + * i + * i (arr[i] * ) / max_value)}

bitmapSave(ResponseOutputStream SystemDrawingImagingImageFormatGif)}

               

上一篇:ASP.NET 创建自定义数据控制器基类

下一篇:ASP.NET 实现SQL注入过滤