Bitmap *p = new Bitmap(row,column,row*sizeo(char),System:rawing::Imaging::PixelFormat::Format8bppIndexed,iP);
this is wrong. you are relating to the wrong thing. the
row*sizeo(char)
should be the size in bytes of the stride... meaning one line of the image. so it should be (assuming you are using 8 bits-per-pixel)
Bitmap *p = new Bitmap(row,column,row,System:rawing::Imaging::PixelFormat::Format8bppIndexed,iP);
it is now "row" because it's "row*1" since each pixel has 8bits = 1 byte.
as for the rest of the code, i cant say much.