当您按下alt +打印屏幕时(至少在Windows中),您会获得当前活动(和可见?)窗口的屏幕截图。
如何使用win32Api调用来调用它?
答案 0 :(得分:0)
Win32::Screenshot
怎么样?
https://github.com/jarmo/win32screenshot
gem install win32screenshot
require 'win32/screenshot'
# Take a screenshot of the foreground
Win32::Screenshot::Take.of(:foreground).write("image.png")
# Take a screenshot of the window with the specified title
Win32::Screenshot::Take.of(:window, :title => "Abc").write("image.bmp")