Increasing screen capture speed when using Java and awt.Robot

后端 未结 2 1366
生来不讨喜
生来不讨喜 2021-01-04 10:26

Edit: If anyone also has any other recommendations for increasing performance of screen capture please feel free to share as it might fully address my problem!

Hello

2条回答
  •  春和景丽
    2021-01-04 11:06

    I guess that the intensive memory usage is an issue here. You are capturing in your tests about 250 screenshots. Depending on the screen resolution, this is:

    1280x800 : 250 * 1280*800  * 3/1024/1024 ==  732 MB data
    1920x1080: 250 * 1920*1080 * 3/1024/1024 == 1483 MB data
    

    Try caputuring without keeping all those images in memory.

    As @Obicere said, it is a good idea to keep the Robot instance alive.

提交回复
热议问题