Browse Source

Merge pull request #843 from mewpull/CapturePix

CapturePix bin exact
pull/88/head
Robin Eklind 7 years ago committed by GitHub
parent
commit
8e1a336afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      Source/capture.cpp

15
Source/capture.cpp

@ -85,18 +85,17 @@ BOOL __fastcall CapturePix(HANDLE hFile, WORD width, WORD height, WORD stride, B
BYTE *pBuffer, *pBufferEnd;
pBuffer = (BYTE *)DiabloAllocPtr(2 * width);
do {
if (!height) {
mem_free_dbg(pBuffer);
return TRUE;
}
while (height != 0) {
height--;
pBufferEnd = CaptureEnc(pixels, pBuffer, width);
pixels += stride;
writeSize = pBufferEnd - pBuffer;
} while (WriteFile(hFile, pBuffer, writeSize, &lpNumBytes, 0) && lpNumBytes == writeSize);
return FALSE;
if (!(WriteFile(hFile, pBuffer, writeSize, &lpNumBytes, 0) && lpNumBytes == writeSize)) {
return FALSE;
}
}
mem_free_dbg(pBuffer);
return TRUE;
}
BYTE *__fastcall CaptureEnc(BYTE *src, BYTE *dst, int width)

Loading…
Cancel
Save