Hi all,
I have got a problem regarding Bitmap file. To read the bitmap (256x256) file I use two dimensional array by scrip the header.
Now after doing something on the ori_mat array (not reverse or other thing, just something with value), I want to show the image on a picture box using setpixel() function.Code:for (x =0; x <256; x++) { for (y =0; y<256; y++) { c1.ori_mat[x, y] = (byte)image1.ReadByte(); } }
But the image is shown in the picture box is reverse or mirrored (not the same as original picture).Code:Bitmap img = new Bitmap(256, 256); for (int i = 0; i < 256; i++) for (int j =0; j<256; j++) { img.SetPixel(i,j, Color.FromArgb(c1.ori_mat[i, j], c1.ori_mat[i, j],c1.ori_mat[i,j])); } pictureBox1.Image= img;
Can someone please whats my problem. Thanks in advance.
Take care and bye.


Reply With Quote

Bookmarks