Watir2.0.1之——屏幕截图
来源:互联网 发布:ubuntu重命名文件夹 编辑:程序博客网 时间:2024/04/30 10:31
现在实现的功能是ruby的截图模块。主要是通过win32screenshot gem来完成的。
首先是安装:win32screenshot
http://rubygems.org/gems/win32screenshot
gem install win32screenshot
其次就可以来进行测试了。
require 'win32/screenshot'# Take a screenshot of the window with the specified title 用来获取特殊标题的窗口图片,比如说打开某个文件夹。Win32::Screenshot::Take.of(:window, :title => "Windows Internet Explorer").write("image.bmp")# Take a screenshot of the foreground 用来获取当前窗口的图片Win32::Screenshot::Take.of(:foreground).write("image.png")# Take a screenshot of the specified window's top-left corner's area 获取特定区域的图片Win32::Screenshot::Take.of(:window, :title => /internet/i, :area => [10, 10, 20, 20]).write("image.jpg")# Take a screenshot of the window with the specified handle Win32::Screenshot::Take.of(:window, :hwnd => 123456).write("image.gif")# Take a screenshot of the child window with the specified internal class name 可以获取子对象的图片Win32::Screenshot::Take.of(:rautomation, RAutomation::Window.new(:hwnd => 123456). child(:class => "Internet Explorer_Server")).write("image.png")# Use the bitmap blob for something elseimage = Win32::Screenshot::Take.of(:window, :hwnd => 123456)image.height # => height of the imageimage.width # => width of the imageimage.bitmap # => bitmap blob
- Watir2.0.1之——屏幕截图
- Watir2.0.1之——简介及实例
- unity之屏幕截图
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- 多媒体编程——屏幕截图
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- OC常用分类——屏幕截图
- Quartz2D——屏幕截图,背景平铺
- Android getDecorView用途——屏幕截图
- Android getDecorView用途——屏幕截图
- PHP之屏幕生成截图
- iphone开发之屏幕截图
- linux之设备屏幕截图
- SQL其他概念
- JDBC简介(二)
- Web本地计算发展史
- 解决方案:silverlight嵌入到aspx页面中后,该页面中弹出层被silverlight所在的层遮盖了
- ProgressDialog的dismiss方法与cancel方法的区别
- Watir2.0.1之——屏幕截图
- Flash比较值水平翻转(ScaleX =-1)和垂直翻转(ScaleY=-1)
- sql练习
- CSS3.0中文手册及相关资源
- Upload/Download SAP Scripts To/From PC
- 人生三大幸运
- DalVik学习之利器篇--如何使用smali
- 堆栈溢出原理
- 深入理解计算机系统-hello world的旅程