I used the following method to take a screenshot of all the monitors. It works flawlessly, but I just upgraded to Windows 10 and am seeing a major issue. I am getting blank/transparent areas.
Regular screenshot using PrtScn
: https://i.stack.imgur.com/octsD.png
Using my algorithm: https://i.stack.imgur.com/NivwE.png
my algorithm details
My algorithm is called from a Firefox, and it takes a screenshot after 5 seconds. At the time of screenshot, Notepad++ was focused.
EnumDisplayDevices
CreateDC
withlpszDriver
andlpszDevice
obtained from step 1CreateCompatibleDC
on result of step 2CreateDIBSection
on result of step 2SelectObject
results of step 2 onto result of step 4BitBlt
Here is the WinAPI calls from my code, it is in js-ctypes:
ostypes.API('EnumDisplayDevices')(null, iDevNum, lpDisplayDevice.address(), 0);
var hdcScreen = ostypes.API('CreateDC')(collMonInfos[s].otherInfo.lpszDriver, collMonInfos[s].otherInfo.lpszDevice, null, null);
var hdcMemoryDC = ostypes.API('CreateCompatibleDC')(hdcScreen);
var hbmp = ostypes.API('CreateDIBSection')(hdcScreen, bmi.address(), ostypes.CONST.DIB_RGB_COLORS, pixelBuffer.address(), null, 0);
var rez_SO = ostypes.API('SelectObject')(hdcMemoryDC, hbmp);
var rez_BB = ostypes.API('BitBlt')(hdcMemoryDC, 0, 0, w, h, hdcScreen, 0, 0, ostypes.CONST.SRCCOPY);
// i then draw pixelBuffer to a html5 canvas
Has anyone else experienced these blank spaces? Anyone know solution?