电脑单机双人游戏推荐:求用CImage类实现图象旋转的代码!或者帮我看一下我的代码问题在那里?

来源:百度文库 编辑:神马品牌网 时间:2024/05/10 11:42:37
我写的代码如下:
for (int x=0; x<Width; x++)
for (int y=0; y<Height; y++)
{
COLORREF pixel=pImage->GetPixel(x,y);
red[x][y]= GetRValue(pixel);
green[x][y]= GetGValue(pixel);
blue[x][y] = GetBValue(pixel);
}
for (int x=0; x<Width; x++)
for (int y=0; y<Height; y++)
{
byte r,g,b;
r=red[x][y];
g=green[x][y];
b=blue[x][y];
pImage->SetPixelRGB(Width-x,y,r,g,b);
}
pImage的定义为:CImage* pImage
编译可通过,就是运行的时候老说有未处理的异常,提示堆栈溢出:stack overflow!这是为什么?
又或者给我一段实现好的代码也可以!