HairyRabbit / gw2-autofish

0 stars 0 forks source link

The win32 screenshot problem. #2

Open Jai-wei opened 1 year ago

Jai-wei commented 1 year ago

Hello, when I use the 'cap' function to take a screenshot of the game, because it uses win32 implementation, the screenshot is black screen. Is there any other way to take screenshots in the background of directx games?

HairyRabbit commented 1 year ago

cap is not work currently, can replace with following code:

import numpy as np
from mss.windows import MSS as mss

def cap1():
  with mss() as sct:
    montior = { "left": 0, "top": 0, "width": 1360, "height": 760 } # your game window position
    img = np.array(sct.grab(montior))
    return img

ensure you game window on the top.


发件人: Javier @.> 发送时间: 2023年6月7日 15:45 收件人: HairyRabbit/gw2-autofish @.> 抄送: Subscribed @.***> 主题: [HairyRabbit/gw2-autofish] The win32 screenshot problem. (Issue #2)

Hello, when I use the 'cap' function to take a screenshot of the game, because it uses win32 implementation, the screenshot is black screen. Is there any other way to take screenshots in the background of directx games?

― Reply to this email directly, view it on GitHubhttps://github.com/HairyRabbit/gw2-autofish/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABL4QRWQDI7YCREEWJJU5KDXKAWQXANCNFSM6AAAAAAY5OQU3I. You are receiving this because you are subscribed to this thread.Message ID: @.***>