VB.NET Window Screen Capture (ALT+PRINTSCREEN)

前端 未结 5 1428
渐次进展
渐次进展 2021-01-03 02:25

I found that code somewhere and I find it quite useful but I would like to find a way to make it work so it capture only the given window target. Maybe with a processID or W

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-03 02:52

    The easiest way to do it, though it's a hack, is this:

    SendKeys.Send("{PRTSC}")
    Dim Screenshot As Image = Clipboard.GetImage()
    Screenshot.Save("c:\ScreenShot.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
    

提交回复
热议问题