Graphics::TBitmap *bitmap;
Byte *ptr;
bitmap->LoadFromFile("c:\\*.bmp");
bitmap->PixelFormat=pf32bit;
for(int y = 0; y < bitmap->Height; y++)
{
ptr = static_cast<Byte*>(bitmap->ScanLine[y]);
for (int x = 0; x < bitmap->Width*4; x++)
{
ptr[x] = RGB(255-GetRValue(ptr[x]),255-GetGValue(ptr[x]),255-GetBValue(ptr[x]));
}
}; ImageS->Canvas->Draw(0,0,bitmap);
以上是一个图像反百的程序,如果我要用类似的方法调整这幅图像的色阶(类似photoshop中的色彩平衡处理)该怎么去做,请高手赐教。
Byte *ptr;
bitmap->LoadFromFile("c:\\*.bmp");
bitmap->PixelFormat=pf32bit;
for(int y = 0; y < bitmap->Height; y++)
{
ptr = static_cast<Byte*>(bitmap->ScanLine[y]);
for (int x = 0; x < bitmap->Width*4; x++)
{
ptr[x] = RGB(255-GetRValue(ptr[x]),255-GetGValue(ptr[x]),255-GetBValue(ptr[x]));
}
}; ImageS->Canvas->Draw(0,0,bitmap);
以上是一个图像反百的程序,如果我要用类似的方法调整这幅图像的色阶(类似photoshop中的色彩平衡处理)该怎么去做,请高手赐教。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货