- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
robot类(robot类)
robot类(robot类)
Use the Robot class to create your own Java version of the screen capture program
This article shows how to use Javas Robot class to create a screen capture program that captures the contents of the home screen. This program handles capturing the screen, and also saves the entire screen or part of the screen into a.Jpg file.
The java.awt.Robot class is really fun. Playing Robot can give you a lot of fun. Next, lets look at how Robot creates your own screen capture program.
Program interface
The following is the interface of my screen capture program. You can use it to capture the screen, cut the selected picture content, and save the result as a.Jpg file.
Capture1.jpg
The screen capture programs interface is simple, including a menu and a scrolling window for displaying and capturing images. Press the left mouse button on the window to drag the mouse. Youll see a red dashed rectangle. This is the image selection box. After you select the picture, select the clipping menu to cut the image. See below:
Capture2.jpg
system implementation
This procedure includes 3 source files:
Capture.java: start the application and build GUI;
ImageArea.java: a component that displays and selects screen images;
ImageFileFilter.java: file selection filter, which can only select JPEG files.
Next, I will combine code snippets to introduce how to implement screen capture programs.
Screen capture
To create a screen capture using the Robot class, you first create the Robot object. In the Capture public static void main (String args Robot public []) in Robot () to create a Robot object. If the creation is successful, the Robot reference of the home screen coordinate system is returned. If the platform does not support low-level control, the java.awt.AWTException is thrown. If the platform does not allow the creation of Robot, the java.lang.SecurityException is thrown. I hope you will not throw the above two exceptions on your platform.
Assuming that the Robot object has been cre
您可能关注的文档
- 提高摄像水平(Improve camera level).doc
- 提高法治水平,领导干部当作表率(Improve the rule of law, leading cadres as an example).doc
- 提振内需需要综合治理(Boosting domestic demand requires comprehensive governance).doc
- 提高解题能力,不仅仅是应试的需要,也是素质提 -(To improve the problem-solving ability is not only the need for examination, but also the quality).doc
- 提高领导干部网络社会管理能力(Improving network social management ability of leading cadres).doc
- 揭示穷人如何致富秘诀——创业点子(Revealing the secrets of how the poor get rich - the idea of entrepreneurship).doc
- 揭秘18个欧洲国家的首富如何赚钱(Secret 18 European countries, the richest man how to make money).doc
- 揭秘四大年龄段女性理财经 教你变身成财女(Secret four years of age, female financial management, taught you to become a financial woman).doc
- 揭秘自行车的轮胎尺寸(Bicycle tyre size).doc
- 揭秘食堂税务职工午餐费纳税学问(Secret canteen tax staff lunch fee tax knowledge).doc
- qq飞车技巧(QQ Speed skills).doc
- rockshox前叉介绍(rockshox前叉介绍).doc
- rotork学习大纲(Rotork learning syllabus).doc
- rrr杆组运动分析子函数(RRR rod group; kinematic analysis; sub function).doc
- rsmsy5_readme(rsmsy5_readme).doc
- rtgfrtgr(rtgfrtgr).doc
- rtk-知识(Rtk- knowledge).doc
- s40最全教程(S40 most complete tutorial).doc
- rflp(限制性片段长度多态性).doc
- sage技术(sage技术).doc
最近下载
- 高中生生涯与学科融合规划教育 生涯融合MY FIRST WORK ASSIGNMENT.pptx VIP
- 2025年液压支架工(技师)职业技能鉴定理论考试题库(含答案).docx VIP
- 配网接地故障处理流程(班组大讲堂).pptx VIP
- 数控磨床说明书.pdf
- 2024-2025学年初中美术七年级上册(2024)人教版(2024)教学设计合集.docx
- 国外人工智能大模型发展现状研究.pptx VIP
- [工程科技]浙大中控ECS-700实时监控软件使用手册.pdf VIP
- 大学本科生考研工作实施方案.docx VIP
- 玉溪师范学院本科生考研工作实施方案.doc VIP
- 第2章 大模型:人工智能的前沿.pptx VIP
文档评论(0)