void S_RevColor(Graphics::TBitmap *Bmp)//图片反色 { 0 k- [ ~# ^1 U# o BYTE *ptr; 2 W- o) v& S# Q6 w: G for (int y = 0; y < Bmp->Height; y++) . ]- _) y# |& g* D" N { . c/ ~9 j- U0 d0 \ ptr =(BYTE *) Bmp->ScanLine[y]; for (int x = 0; x < Bmp->Width*3; x+=3){ 3 M @4 `/ }: e1 E& A3 s, w) R- Y" g# | ptr[x]=BYTE(255-ptr[x]); ' }1 W m0 i2 Q( ]9 ]0 Q+ H( C. }1 H4 A ptr[x+1]=BYTE(255-ptr[x+1]); ptr[x+2]=BYTE(255-ptr[x+2]); ' }4 \" S* c1 t$ P/ _9 h6 I; q } } }
| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |