Java Robot createScreenCapture performance

前端 未结 2 1889
借酒劲吻你
借酒劲吻你 2021-02-13 23:52

I need to grab a series of screenshots and concatenate them into a movie. I\'m trying to use the java Robot class to capture the screen.

But the createScreenCapture() m

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-14 00:19

    I'd suggest going with C or C++ for this, it has much more direct access to the hardware.

    If you want the absolute maximum performance go to the driver level and just take the data straight off the video card. It's difficult to find a driver like this because it could be used to easily defeat any copy protection since it grabs the data as it's going to the screen.

    But if you need to stick with Java and Robot, are you sure it's just this one function call which is taking so long? It's not allocating a BufferedImage or something else?

提交回复
热议问题