Your variables called name, str, str2, img2 and n are all superfluous to what you are trying to achieve.
Try this:
private void fileToolStripMenuItem_Click(object sender, EventArgs e)
{
Bitmap img;
OpenFileDialog opendialog1 = new OpenFileDialog();
opendialog1.InitialDirectory = "D:\\frames";
opendialog1.Filter = "Image File|*.bmp;";
opendialog1.Title = " Open Image file";
if (opendialog1.ShowDialog() == DialogResult.OK)
{
img = new Bitmap(opendialog1.FileName);
pictureBox1.Image = img;
img = new Bitmap("D:\\frames\\0001.bmp");
pictureBox2.Image = img;
img = new Bitmap("D:\\frames\\0002.bmp");
pictureBox3.Image = img;
img = new Bitmap("D:\\frames\\0003.bmp");
pictureBox4.Image = img;
}
}
You could even eliminate the img variable and assign the picture box images directly:
pictureBox1.Image = new Bitmap(opendialog1.FileName);
pictureBox2.Image = new Bitmap("D:\\frames\\0001.bmp");
pictureBox3.Image = new Bitmap("D:\\frames\\0002.bmp");
pictureBox4.Image = new Bitmap("D:\\frames\\0003.bmp");