BMP.Height 또는 BMP.Width를 설정하려고 할 때 BMP 파일로 작업하려고하면 "EOutofresources - 저장 공간이 충분하지 않습니다"라는 메시지가 나타납니다. 이러한 지침을 수행 한 후에 스택 추적은 다음과 같습니다 (이 순서대로) : ntdll.dll.RtlLeaveCriticalSection, kernel32.dll.FileTimeToDosDateTime, GDI32.dll.GdiReleaseDC, GDI32.dll.PatBlt, kernel32.dll.ReadFile 또는 이와 유사 :비트 맵으로 작업 할 때 "저장 공간이 부족합니다"오류가 발생했습니다.
|7E429130|user32.dll GetParent
|7C90FF2D|ntdll.dll RtlGetNtGlobalFlags
|77F15A00|GDI32.dll GdiReleaseDC
|7C83069E|kernel32.dll FileTimeToDosDateTime
|7C9010E0|ntdll.dll RtlLeaveCriticalSection
| |my function (where I set BMP.Height or BMP.Width)
순간에 나는 메모리 조각화로 무언가를해야한다고 확신했다. 시스템은 내 이미지를 처리하기에 충분한 양의 램이 있었지만 메모리가 조각 났으므로 내 이미지를 저장할만큼 큰 블록이 없었다. 그러나 Windows를 시작한 후 11 초에 한 번 발생했습니다. 내 프로그램은 이미지를 한 번만 처리하는 루프를 순환합니다! 따라서 RAM 조각화와 관련이 없습니다.
다른 상황 (하지만 여전히 도면 관련) 나는이 오류가 발생했습니다 경우는 다음과 같습니다 :
|77F16A7E|GDI32.dll IntersectClipRect
|77F16FE5|GDI32.dll BitBlt
|7E429011|user32.dll OffsetRect
|7E42A97D|user32.dll CallWindowProcA
|7E42A993|user32.dll CallWindowProcA
|7C9010E0|ntdll.dll RtlLeaveCriticalSection
|7E4196C2|user32.dll DispatchMessageA
|7E4196B8|user32.dll DispatchMessageA
|0058A2E1|UTest.exe UTest.dpr
|7C90DCB8|ntdll.dll ZwSetInformationThread
내가 BMP.Height 후 스택 추적에서 'RtlLeaveCriticalSection'호출이 항상있다 생각합니다.
Windows 레지스트리 키를 편집하여 가능한 해결책을 가리키는 this 게시물이 있습니다. 그러나이 게시물은 Windows XP에만 적용됩니다. 내 오류 승 7
에도 나타납니다 동안 나는 그러나 그는 오류를 수정보고 돌아 왔어요 아무도 때까지 (그들 중 일부는 디스크에 파일을 저장하는 연결 가까운) 많은 유사한 게시물을 참조하십시오.
는 업데이트 :
요청한 바와 같이,이 오류가 나타납니다 코드 : 내 실험에서
procedure TMyBitmap.SetLargeSize(iWidth, iHeight: Integer);
CONST ctBytesPerPixel= 3;
begin
{ Protect agains huge/empty images }
if iWidth< 1 then iWidth:= 1 else
if iWidth> 32768 then iWidth:= 32768;
if iHeight< 1 then iHeight:= 1 else
if iHeight> 32768 then iHeight:= 32768;
{ Set image type }
if iWidth * iHeight * ctBytesPerPixel > 9000000 {~9MB}
then HandleType:= bmDIB { Pros and cons: -no hardware acceleration, +supports larger images }
else HandleType:= bmDDB;
{ Total size is higher than 1GB? }
if (iWidth* iHeight* ctBytesPerPixel) > 1*GB then
begin
Width := 8000; { Set a smaller size }
Height := 8000; { And rise an error }
RAISE Exception.Create('Image is too large.');
end;
{ Set size }
Width := iWidth; <----------------- HERE
Height:= iHeight;
end;
소스 코드를 표시하십시오. 메모리 문제보다 리소스 누출 (즉, 핸들 누출) 소리가납니다. – Yahia
비트 맵의 크기는 얼마입니까? –
비트 맵의 크기는 제한되지 않습니다. 일반적으로 일반 디지털 카메라 사진 (4-16 Mpixels)이어야합니다. – Ampere