我怎么才能触发AddArcExample的方法
我的代码错在哪里?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;namespace WindowsApplication1
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
this.Form6_Load += new EventHandler(AddArcExample);
} private void Form6_Load(object sender, EventArgs e)
{
PaintEventArgs ex=new PaintEventArgs(this.CreateGraphics(),new Rectangle(0,0,this.Width,this.Height));
AddArcExample(ex); }
private void AddArcExample(PaintEventArgs e)
{
// Create a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath(); // Set up and call AddArc, and close the figure.
Rectangle rect = new Rectangle(20, 20, 50, 100);
myPath.StartFigure();
myPath.AddArc(rect, 0, 180);
myPath.CloseFigure(); // Draw the path to screen.
e.Graphics.DrawPath(new Pen(Color.Red, 3), myPath);
}
}
我的代码错在哪里?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;namespace WindowsApplication1
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
this.Form6_Load += new EventHandler(AddArcExample);
} private void Form6_Load(object sender, EventArgs e)
{
PaintEventArgs ex=new PaintEventArgs(this.CreateGraphics(),new Rectangle(0,0,this.Width,this.Height));
AddArcExample(ex); }
private void AddArcExample(PaintEventArgs e)
{
// Create a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath(); // Set up and call AddArc, and close the figure.
Rectangle rect = new Rectangle(20, 20, 50, 100);
myPath.StartFigure();
myPath.AddArc(rect, 0, 180);
myPath.CloseFigure(); // Draw the path to screen.
e.Graphics.DrawPath(new Pen(Color.Red, 3), myPath);
}
}
解决方案 »
- C#不使用多个input = file控件来上传文件夹
- C# "null" "" 和 null的区别
- GridView添加空行的问题
- 求助:grideview绑定数据问题
- [请教]抱着最后一丝希望,再发一贴..关于在一个单独的AppDomain中加载Assembly
- 管理员如何实现自定义字段?
- 请教怎样将dataset中的数据批量保存到数据库中
- 怎么在 c# 中 调用 windows 命令呀
- 求救:一个access数据插入的问题
- 关于DataGridTextBoxColumn的双击的实现
- 求教 关于C#语言用imap做邮件收发操作了?
- C#做的BMP灰度位图放大程序为什么老是发生溢出错误?愁死了,各位大侠帮帮小弟吧!!!!!!!
但是我画的路径怎么没有显示出来,这个是csdn的一个例子上copy来的???