C#如何解决这个问题
我有一个错误,我不知道如何修复。我希望答案是密码。这是错误,错误1没有过载 'turnToVideoToolStripMenuItem\单击'matches delegate'System.EventHandler' C:\Users\kinoa\documents\visualstudio 2013\Projects\armared Animation studio\armared Animation studio\main.Designer.cs 259 56 armared Animation studio 这是代码C#如何解决这个问题,c#,C#,我有一个错误,我不知道如何修复。我希望答案是密码。这是错误,错误1没有过载 'turnToVideoToolStripMenuItem\单击'matches delegate'System.EventHandler' C:\Users\kinoa\documents\visualstudio 2013\Projects\armared Animation studio\armared Animation studio\main.Designer.cs 259 56 armared Animati
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NReco.VideoConverter;
using System.Diagnostics;
using System.IO;
namespace Armored_Animation_Studio
{
public partial class main : Form
{
public Point current = new Point();
public Point old = new Point();
public Graphics g;
public Pen p = new Pen(Color.Black, 5);
public List<Image> Animation = new List<Image>();
public main()
{
InitializeComponent();
g = panel1.CreateGraphics();
p.SetLineCap(System.Drawing.Drawing2D.LineCap.Round,
System.Drawing.Drawing2D.LineCap.Round,
System.Drawing.Drawing2D.DashCap.Round);
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
current = e.Location;
g.DrawLine(p, current, old);
old = current;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
old = e.Location;
if(radioButton1.Checked)
{
p.Width = 1;
}
else if(radioButton2.Checked)
{
p.Width = 5;
}
else if (radioButton3.Checked)
{
p.Width = 10;
}
else if (radioButton4.Checked)
{
p.Width = 15;
}
else if (radioButton5.Checked)
{
p.Width = 30;
}
}
private void button1_Click(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog();
if (cd.ShowDialog() == DialogResult.OK)
p.Color = cd.Color;
}
private void button3_Click(object sender, EventArgs e)
{
panel1.Invalidate();
}
private void radioButton7_CheckedChanged(object sender, EventArgs e)
{
p.Color = System.Drawing.Color.White;
}
private void button2_Click(object sender, EventArgs e)
{
Bitmap bmp = new Bitmap(panel1.Width, panel1.Height);
panel1.DrawToBitmap(bmp, new Rectangle(0, 0, panel1.Width,
panel1.Height));
Animation.Add(bmp);
}
private void turnToVideoToolStripMenuItem_Click(object sender, EventArgs
e, string [] args)
{
Process proc = new Process();
proc.StartInfo.FileName = "ffmpeg";
proc.StartInfo.Arguments = "-i " + args[0] + " " + args[1];
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.UseShellExecute = false;
if (!proc.Start())
{
Console.WriteLine("Error starting");
return;
}
StreamReader reader = proc.StandardError;
string line;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine("ffmpeg -i <imagefile> -vcodec mpeg4 out_movie");
}
proc.Close();
}
}
}
使用系统;
使用System.Collections.Generic;
使用系统组件模型;
使用系统数据;
使用系统图;
使用System.Linq;
使用系统文本;
使用System.Threading.Tasks;
使用System.Windows.Forms;
使用NReco.VideoConverter;
使用系统诊断;
使用System.IO;
动画工作室
{
公共部分类main:表单
{
公共点电流=新点();
公共点旧=新点();
公共图形g;
公共笔p=新笔(颜色:黑色,5);
公共列表动画=新列表();
公用干管()
{
初始化组件();
g=panel1.CreateGraphics();
p、 设置线帽(System.Drawing.Drawing2D.LineCap.Round,
System.Drawing.Drawing2D.LineCap.Round,
系统。图纸。图纸2D。仪表盘。圆形);
}
专用无效面板1u MouseMove(对象发送器,MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
{
当前=e.位置;
g、 抽绳(p,当前,旧);
旧=当前;
}
}
专用无效面板1\u鼠标向下(对象发送方,鼠标目标e)
{
old=e.位置;
如果(radioButton1.选中)
{
p、 宽度=1;
}
否则如果(radioButton2.选中)
{
p、 宽度=5;
}
否则如果(radioButton3.选中)
{
p、 宽度=10;
}
否则如果(收音机按钮4.选中)
{
p、 宽度=15;
}
否则如果(收音机按钮5.选中)
{
p、 宽度=30;
}
}
私有无效按钮1\u单击(对象发送者,事件参数e)
{
ColorDialog cd=新建ColorDialog();
if(cd.ShowDialog()==DialogResult.OK)
p、 颜色=cd.Color;
}
私有无效按钮3\u单击(对象发送者,事件参数e)
{
1.使无效();
}
私有void radioButton7_CheckedChanged(对象发送方,事件参数e)
{
p、 颜色=System.Drawing.Color.White;
}
私有无效按钮2\u单击(对象发送者,事件参数e)
{
位图bmp=新位图(panel1.Width,panel1.Height);
panel1.DrawToBitmap(bmp,新矩形(0,0,panel1.宽度,
(1.高度);
添加动画(bmp);
}
私有void turnToVideoToolStripMenuItem\u单击(对象发送方,事件参数
e、 字符串[]args)
{
Process proc=新流程();
proc.StartInfo.FileName=“ffmpeg”;
proc.StartInfo.Arguments=“-i”+args[0]+”“+args[1];
proc.StartInfo.RedirectStandardError=true;
proc.StartInfo.UseShellExecute=false;
如果(!proc.Start())
{
Console.WriteLine(“启动错误”);
返回;
}
StreamReader reader=proc.StandardError;
弦线;
而((line=reader.ReadLine())!=null)
{
WriteLine(“ffmpeg-i-vcodecmpeg4out_电影”);
}
过程关闭();
}
}
}
谢谢大家! 更改方法签名:
private void turnToVideoToolStripMenuItem_Click(object sender, EventArgs e, string [] args)
致:
将处理编译器错误,但您只需要获取预期位于args中的数据。您希望在最后一个参数中传递什么?从turnToVideoToolStripMenuItem\u Click声明中删除
,string[]args
。为什么在事件末尾添加string[]args?
private void turnToVideoToolStripMenuItem_Click(object sender, EventArgs e)