暂时采用C++ ,稍后转换为Delphi
void __fastcall TForm1::Button1Click(TObject *Sender)
{
float K = 0.5;
for(int h=0; h<Image1->Picture->Height; h++) {
BYTE* pB = (BYTE*)Image1->Picture->Bitmap
->ScanLine[h];
for(int w=0; w<Image1->Picture->Width; w++) {
pB[0] = pB[0]*K + 255*(1-K);
pB[1] = pB[1]*K;
pB[2] = pB[2]*K;
pB += 3;
}
}
Image1->Repaint();
}