TColor警告提示问题,请帮忙!
下面是代码:
void __fastcall TForm1::BitBtn2Click(TObject *Sender) //最大值法灰度化{float red, green, blue, max;TColor color;width = Image1 -> Picture -> Width;height = Image1 -> Picture -> Height;bitmap = new Graphics::TBitmap();bitmap -> Width = width;bitmap -> Height = height;for(i = 0; i < width-1; i++) for(j = 0; j < height-1; j++) { color = Image1 -> Canvas -> Pixels[i][j]; red = rgb[i][j].r_color = GetRValue(color); green = rgb[i][j].g_color = GetGValue(color); blue = rgb[i][j].b_color = GetBValue(color); max = red > green ? red : green > blue ? green : blue; bitmap -> Canvas -> Pixels[i][j] =RGB(max, max, max); } Image2 -> Picture -> Bitmap -> Assign(bitmap);}