怎么把这段代码翻译成vc++的呢

如何把这段代码翻译成vc++的呢?
byte *ptr;
int width = aImage->Width,height = aImage->Height;
int pageNum = width*height/8;
aImage->PixelFormat = pf24bit;

/* 宽高判断 */
if(width%8 || width < 8 || height < 8) return false;
for(int y=0;y<height;y++)
{
ptr = static_cast<byte*>(aImage->ScanLine[y]);
for(int x=0;x<width;x++)
{
int dot = x*3,aBit =(7- x%8);
int p = y*(width/8) + x/8;     //一页大小

if(!(x%8))
{
data[p] = 0;
if( AColor >= 1 ) data[p+pageNum] = 0;
if( AColor >= 2 ) data[p+ (2 * pageNum)] = 0;
}

/* 过滤颜色 */
if(FilterColor ==(TColor)((ptr[dot]<<16) + (ptr[dot+1]<<8) + ptr[dot+2])) continue;

/* 扫描红色 */
if(ptr[dot+2] >= range)
data[p] += (1<<aBit);

/* 扫描绿色 */
if(ptr[dot+1] >= range)
if( AColor >= 1 ) data[p+pageNum] += (1<<aBit);

            /* 扫描蓝色 */
if(ptr[dot+0] >= range)
if( AColor >= 2 ) data[p + (2 * pageNum)] += (1<<aBit);
}
}
return true;

------解决方案--------------------
VC里没有TBitmap类,只能用CBitmap类。用法有差异。
------解决方案--------------------
翻译成通用的吧,将参数Graphics::TBitmap *aImage,换成HBITMAP hBitmap,获取图像信息时通过BITMAPHEADER来操作。