首页 > 学院 > 开发设计 > 正文

图片反色的一段程序

2019-11-17 05:31:17
字体:
来源:转载
供稿:网友

  void S_RevColor(Graphics::TBitmap *Bmp)//图片反色
{
BYTE *ptr;
for (int y = 0; y < Bmp->Height; y++)
  {
  ptr =(BYTE *) Bmp->ScanLine[y];
  for (int x = 0; x < Bmp->Width*3; x+=3)
    {
    ptr[x]=BYTE(255-ptr[x]);
    ptr[x+1]=BYTE(255-ptr[x+1]);
    ptr[x+2]=BYTE(255-ptr[x+2]);
    }
  }


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表