Hello everyone, i 'built' a simple windows forms application, with 2 buttons and 1 picturebox. One button is used for invoking an open file dialog, which prompts for a BMP from the harddisk, which is inserted on the picturebox.
The other button should do 'stuff' to the image, in a separate thread. I've done a similar app before, but now it's different: I have to pass arguments to the method to-be-contained by the thread.
//Method which should be contained by the thread.
void ConstructColors(int i, int j, Color col)
{
//code
//PS: Works recursively, just as a note.
}
//Event which should invoke ConstructColors:
private void AnalyzeButton_Click(object sender, EventArgs e)
{
Thread mythread = new Thread (...).
}
I looked online for help, but couldn't find anything, i need to know how to pass arguments to the thread.
Also, i would like to be able to determine the main thread to wait for the second, until it's finished its work.
Thanks!