Hello,
I am working with images and I have got a problem. I have this method and I want it to return an array of unsigned ints. I have not got problems of compilation but it does not work properly.
Could anyone help me?
Thank you in advanced.
unsigned int* RegionToArray(System::Drawing::Bitmap^ binaryImage,unsigned int coordinate_x, unsigned int coordinate_y, unsigned int width_rect, unsigned int height_rect){
coordinate_x=this->coordinate_x;
coordinate_y=this->coordinate_y;
width_rect=this->width_rect;
height_rect=this->height_rect;
unsigned int cont=0;
unsigned int *regionArray;
regionArray=new unsigned int[height_rect*width_rect];
for(unsigned int i=coordinate_x;i<height_rect;i++)
{
for(unsigned int j=coordinate_y;j<width_rect;j++)
{
System::Drawing::Color^ colour;
colour=gcnew System::Drawing::Color();
colour=binaryImage->GetPixel(i,j);
unsigned int col;
col=colour->ToArgb();
regionArray[cont]=col;
cont++;
}
}
return regionArray;
}