private void CreateImage()
{
//获取男员工数目
int man = 40;
//获取女员工数目
int woman = 60;
int Sum = man+woman;
//创建画图对象
int width=400,height=450;
Bitmap bitmap = new Bitmap(width,height);
Graphics g = Graphics.FromImage(bitmap);
try
{
//清空背景色
g.Clear(Color.White);
Pen pen1 = new Pen(Color.Red);
Brush brush1 = new SolidBrush(Color.YellowGreen);
Brush brush2 = new SolidBrush(Color.Blue);
Brush brush3 = new SolidBrush(Color.Brown);
Font font1 = new Font("Courier New",16,FontStyle.Bold);
Font font2 = new Font("Courier New", 8);
g.FillRectangle(brush1, 0, 0, width, height); //绘制背景图
g.DrawString("公司男女比例饼形图", font1, brush2, new Point(80, 20)); //书写标题
int piex = 100, piey = 100, piew = 150, pieh = 150;
//男员工在圆中分配的角度
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载
- 1
- 2
- 3
前往页