Lorsque je le règle sur double écran, les deux écrans apparaissent dans une seule image avec la capture d'écran par défaut de Windows. Je veux une image d'un seul écran.
screenshot-cropper.py
# -*- coding:utf8 -*-
import sys
import os
import cv2
import numpy as np
def main():
    if not (len(sys.argv) == 2):
        return
    img_path = sys.argv[1]
    if not os.path.exists(img_path):
        return
    img_array = np.fromfile(img_path, dtype=np.uint8)
    img = cv2.imdecode(img_array, cv2.IMREAD_COLOR)
    img_cropped = img[0:1080, 1080:3000]
    root, ext = os.path.splitext(img_path)
    img_cropped_path = root + '_cropped' + ext
    result, img_cropped_array = cv2.imencode(ext, img_cropped)
    img_cropped_array.tofile(img_cropped_path)
if __name__ == '__main__':
    main()
screenshot-cropper.bat
python "C:\path\to\screenshot-cropper.py" %1
Path \ to \ doit être le chemin réel