我是 C++ 新手,不明白为什么会收到错误“访问冲突读取位置”。这是我的代码:
gdiscreen();
int startX = 1823 - minusX;
int startY = 915 - minusY;
for (int i = startX; i < startX + 61; i++)
{
for (int j = startY; j < startY + 70; j++)
{
Color pixelColor;
bitmap->GetPixel(i, j, &pixelColor);
cout << pixelColor.GetValue() << " ";
}
cout << endl;
}
gdiscreen() 可以在这里找到: http ://forums.codeguru.com/showthread.php?476912-GDI-screenshot-save-to-JPG