2017-10-12 17 views
-2

해결 방법이 없다는 오류가 있습니다. 나는 코드에서 그 답을 이해할 것이다. 오류 1, 오류 1 에 대한 과부하 없음 'turnToVideoToolStripMenuItem_Click'이 위임 'System.EventHandler'와 일치 함 C : \ Users \ kinoa \ documents \ visual 스튜디오 2013 \ Projects \ Armored 애니메이션 Studio \ Armored Animation Studio \ main.Designer.cs 259 56 장갑 된 애니메이션 스튜디오. 이 코드입니다C#이 문제를 해결하는 방법

,

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(); 
    } 


} 
} 

감사합니다!

+4

', string [] args'를 turnToVideoToolStripMenuItem_Click 선언에서 제거하십시오. –

+3

왜 이벤트 마지막에 string [] args를 추가 했습니까? – Amit

답변

1

변경 메소드 서명 :

private void turnToVideoToolStripMenuItem_Click(object sender, EventArgs e, string [] args) 

에 :

private void turnToVideoToolStripMenuItem_Click(object sender, EventArgs e) 

컴파일러 오류를 돌봐,하지만 당신은 당신이 인수 될 것으로 예상되는 데이터에 점점 남아 있습니다. 마지막 매개 변수에 전달할 것으로 예상되는 것은 무엇입니까?