Passing a string into a Bitmap reference
Passing a string into a Bitmap reference Hi I'm Having trouble with the following code. I have multiple pictureboxes in my app and would like to compare them two at a time, by using the same function. When I run the code I get the following error "the reference is not valid, and I'm not sure where to go from here. My Code private void ImageCompare37() { Checkimage = "test"; im1 = "Pic37.Image"; imc1 = "PicComp37.Image"; MainCompare(); } private void MainCompare() { int g11, g22, r11, r22, b11, b22, x1, y1, z1, x2, y2, z2; Bitmap img1, img2; int i, j; img1 = new Bitmap(im1); img2 = new Bitmap(imc1); for (i = 0; i < img1.Width; i++) { for (j = 0; j < img1.Height; j++) { a = img1.GetPixel(i, j); b = img2.GetPixel(i, j); } } String g1 = a.G.ToString(); String g2 = b.G.ToString(); String r1 = a.R.ToString(); String r2 = b.R.ToStr...