java里面有捕获屏幕的函数么?

blacksoul 2004-04-08 12:16:49
小弟需要捕获当前屏幕内容,然后再显示出来,谢谢!
...全文
49 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
blacksoul 2004-04-08
  • 打赏
  • 举报
回复
恩,好的,谢谢提醒~~
找到了
public byte[] getSnapshot(java.lang.String imageType)
throws MediaExceptionGets a snapshot of the displayed content. Features and format of the captured image are specified by the imageType. All implementations support at least PNG format. Available formats can be queried from System.getProperty with video.snapshot.encodings as the key.
Parameters:
imageType - Format and resolution of the returned image. If null is given, it will default to using the PNG format.
Returns:
image as a byte array in required format.
Throws:
IllegalStateException - Thrown if initDisplayMode has not been called.
MediaException - Thrown if the requested format is not supported.
SecurityException - Thrown if the caller does not have the security permission to take the snapshot.

正在测试j2se里面能不能用…………
kengzai 2004-04-08
  • 打赏
  • 举报
回复
查查Toolkit的API,我记得它可以获取系统屏幕方面的信息,但我没用过它处理屏幕的内容,你试试。
顺便帮你顶一下 8-)

62,616

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧