Capture screenshot of active window?

前端 未结 11 2231
春和景丽
春和景丽 2020-11-21 23:34

I am making a screen capturing application and everything is going fine. All I need to do is capture the active window and take a screenshot of this active window. Does an

11条回答
  •  被撕碎了的回忆
    2020-11-22 00:09

    ScreenCapture sc = new ScreenCapture();
    // capture entire screen, and save it to a file
    Image img = sc.CaptureScreen();
    // display image in a Picture control named imageDisplay
    this.imageDisplay.Image = img;
    // capture this window, and save it
    sc.CaptureWindowToFile(this.Handle,"C:\\temp2.gif",ImageFormat.Gif);
    

    http://www.developerfusion.com/code/4630/capture-a-screen-shot/

提交回复
热议问题