怎么删除bmp图象中指定的一行或一列

如何删除bmp图象中指定的一行或一列?
请教各位:我将一幅图象的背景与前景分离后,设背景为白色,现在想删除白色背景,只在图象中保留一小块内容,所以就对行象素颜色进行了判断,但不知道如何删除一整行的图象信息,有没有什么函数能直接删除行或列的啊?

------解决方案--------------------
给你一个示例
32*32的图变成16*16的
CBitmap bitmap;
CString strFileName;

strFileName = ....;
HBITMAP hbmp;
hbmp= (HBITMAP)::LoadImage( AfxGetInstanceHandle(),
strName,IMAGE_BITMAP,0,0,
LR_LOADFROMFILE);
if (hbmp == NULL)
{
return -1;
}

bitmap.Attach( hbmp ) ;

BITMAP bmp;
CBitmap *pBitmap1 = CBitmap::FromHandle( hbmp );
pBitmap1-> GetBitmap( &bmp );
BYTE *pBigData = new BYTE[bmp.bmBitsPixel*bmp.bmHeight*bmp.bmWidth/8];
BYTE *pSmallData = new BYTE[bmp.bmBitsPixel*bmp.bmHeight*bmp.bmWidth/32];
pBitmap1-> GetBitmapBits( bmp.bmBitsPixel*bmp.bmHeight*bmp.bmWidth/8, pBigData);

for(int i=0;i <16;i++)
for(int j=0;j <16;j++)
{
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+1) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+1);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+2) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+2);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+3) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+3);
}

CBitmap bitmap2;
bitmap2.CreateBitmap( bmp.bmWidth/2, bmp.bmHeight/2, bmp.bmPlanes, bmp.bmBitsPixel, pSmallData);

nRet = m_imagelist.Add( &bitmap2, RGB(255 , 255 , 255 ) ) ;

delete pBigData;
delete pSmallData;
------解决方案--------------------
不能删除某一行的,只能新建位图,把想要的拷过去。无论是缩放增大都是这样做的。
------解决方案--------------------
首先你要知道该行在文件中的开始位置,然后就是这行的长度.长度就是你图象的宽开始位置你可以自己计算出来.然后么直接删除从开始位置的这些数据.如果要实时实现的话,你要把象素读出来.要是可以offline来做的话,那你只要用ue改就可以了.
------解决方案--------------------
2楼的算法其实马上就可以拿来用了你只要在
for(int i=0;i <16;i++)
for(int j=0;j <16;j++)
{
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+1) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+1);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+2) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+2);
*(pSmallData+(i*16+j)*bmp.bmBitsPixel/8+3) = *(pBigData+(i*64+j*2)*bmp.bmBitsPixel/8+3);
}
这里改下把你要删的象素删了
再把这里改成 bitmap2.CreateBitmap( bmp.bmWidth, bmp.bmHeight-1, bmp.bmPlanes, bmp.bmBitsPixel, pSmallData);就ok了.