Hi,
I am new to C# so I don't really know what I am doing.
I am having trouble running a function/method in C# and wonder if anyone can help me. I want to resize a simple image loaded in from openFileDialog. All I want to do is run a function how do I do that?
At the moment I have got:
private void btnConvert_Click(object sender, EventArgs e)
{
Image MyImg = Image.FromFile(openedFile);
Image MyImg2 = Image.FromFile(openedFile);
ResizeImage(MyImg, MyImg2, 523, 523, false);
}
public void ResizeImage(string OriginalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider)
{
}
But for some reason I keep getting an error with the line:
ResizeImage(MyImg, MyImg2, 523, 523, false);
Which is to run the function/method. It comes up with the error "The best overload method match for 'form1.ResizeImage(String, String, Int, Int, Bool)' has some invalid arguments.