i want to take a screen shoot than transfroming it to an array without saving the file as image in a path and loading it again from the path to convert it :
what i want is directly convert the data to an array :
w = 1920
h = 1080
bmpfilenamename = r"path"
hwnd = win32gui.FindWindow(None, "my_window")
wDC = win32gui.GetWindowDC(hwnd)
dcObj=win32ui.CreateDCFromHandle(wDC)
cDC=dcObj.CreateCompatibleDC()
dataBitMap = win32ui.CreateBitmap()
dataBitMap.CreateCompatibleBitmap(dcObj, w, h)
cDC.SelectObject(dataBitMap)
cDC.BitBlt((0, 0),(w, h) , dcObj, (0, 0), win32con.SRCCOPY)
dataBitMap.SaveBitmapFile(cDC, bmpfilenamename) #i want to ignor this phase and directly convert the data to array
My_array = np.array(#myimg , dtype='float')
print(array)
print(array.shape)
My final goal is to feed a neural network predection model with fast stream of screenshots