StretchDIBits failed, sometimes it didn't draw anything,

I am using gdi C ++, StretchDIBits function sometimes fails if I draw large images like 7000 * 5000. Draws nothing. GetLastError () says there is not enough system resource. Can anyone explain why StretchDIBits needs a resource, even the DC has been provisioned successfully.

+2


source to share


1 answer


It is possible that StretchDIBits expands the source image into a temporary bitmap the same size as the target bitmap and then copies the temporary address to the destination. Thus, even if you have enough memory to generate the bitmap (140 MB) prior to calling StretchDIBits, your system does not have the additional 140 MB to accommodate the temporary bitmap.



+1


source







All Articles