我想使用代码创建大位图
LargeBmp := TBitmap.Create;
try
LargeBmp.Width := 1000; // fine
LargeBmp.Height := 15000; // XP - EOutOfResources, Not enough memory, Win 7 - works fine
...
finally
FreeAndNil(LargeBmp);
end;
这段代码在 Windows XP 上会引发一个带有消息“内存不足”的 EOutOfResources
异常,但在 Windows 7 上可以正常工作。
问题出在哪里?为什么会出现“内存不足”?只有60 MB 的内存。
LargeBmp.Height := 15000;
?如果我将代码更改为这样,在 Delphi XE2 上的 Win 7/64 上可以正常工作。 - Gerry Coll