private void openButton_Click(object sender, EventArgs e) { if(openFileDialog1.ShowDialog() == DialogResult.OK) { bmp = new System.Drawing.Bitmap(openFileDialog1.FileName); pictureBox1.Image = bmp; img = new ColorImage(bmp.Height, bmp.Width); img.LoadFromBitmap(bmp); } }