MonkeyImage api
来源:互联网 发布:行者骑行软件 编辑:程序博客网 时间:2024/05/22 10:35
MonkeyImage
A monkeyrunner class to hold an image of the device or emulator's screen. The image is copied from the screen buffer during a screenshot. This object's methods allow you to convert the image into various storage formats, write the image to a file, copy parts of the image, and compare this object to other MonkeyImage
objects.
You do not need to create new instances of MonkeyImage
. Instead, use MonkeyDevice.takeSnapshot()
to create a new instance from a screenshot. For example, use:
newimage = MonkeyDevice.takeSnapshot()
Summary
MonkeyImage
MonkeyImage
object from a rectangular selection of the current image.MonkeyImage
other, float percent)MonkeyImage
object to another and returns the result of the comparison. Thepercent
argument specifies the percentage difference that is allowed for the two images to be "equal".filename
, in the format specified by format
.Public Methods
string convertToBytes ( string format)
Converts the current image to a particular format and returns it as a string that you can then access as an iterable of binary bytes.
Arguments
tuple getRawPixel (integer x, integer y)
Returns the single pixel at the image location (x,y), as an a tuple of integer, in the form (a,r,g,b).
Arguments
Returns
- A tuple of integers representing the pixel, in the form (a,r,g,b) where a is the alpha channel value, and r, g, and b are the red, green, and blue values, respectively.
tuple getRawPixelInt (integer x, integer y)
Returns the single pixel at the image location (x,y), as an an integer. Use this method to economize on memory.
Arguments
Returns
- The a,r,g, and b values of the pixel as 8-bit values combined into a 32-bit integer, with a as the leftmost 8 bits, r the next rightmost, and so forth.
MonkeyImage
getSubImage (tuple rect)
Creates a new MonkeyImage
object from a rectangular selection of the current image.
Arguments
The image's orientation is the same as the screen orientation at the time the screenshot was made.
Returns
- A new
MonkeyImage
object containing the selection.
boolean sameAs ( MonkeyImage
otherImage, float percent )
Compares this MonkeyImage
object to another and returns the result of the comparison. The percent
argument specifies the percentage difference that is allowed for the two images to be "equal".
Arguments
MonkeyImage
object to compare to this one.true
. The default is 1.0, indicating that all the pixels must match.Returns
- Boolean
true
if the images match, or booleanfalse
otherwise.
void writeToFile (string filename, string format)
Writes the current image to the file specified by filename
, in the format specified by format
.
Arguments
- MonkeyImage api
- MonkeyImage API 实践全记录
- MonkeyImage API 教程
- MonkeyImage基本API
- MonkeyImage
- MonkeyRunner—API篇之MonkeyImage&MonkeyRunner
- MonkeyImage函数
- 第3章3节《MonkeyRunner源码剖析》脚本编写示例: MonkeyImage API使用示例(原创)
- Android自动测试之MonkeyRunner之MonkeyImage
- MonkeyRunner_MonkeyRunner,MonkeyDevice,MonkeyImage可以调用的方法
- MonkeyImage的sameAs方法老是出错
- Android自动测试之MonkeyRunner之MonkeyImage
- 《MonkeyRunner原理剖析》第九章-MonkeyImage实现原理 - 第八节 - MonkeyRunner和MonkeyImage图片操作
- 《MonkeyRunner 原理剖析》第九章-MonkeyImage 实现原理 - 第八节 - MonkeyRunner 和 MonkeyImage 图片操作
- Android自动化测试之MonkeyRunner之MonkeyImage(十)
- 《MonkeyRunner原理剖析》第九章-MonkeyImage实现原理 - 概览
- 《MonkeyRunner原理剖析》第九章-MonkeyImage实现原理 - 第一节 - 关键类作用及关系
- 《MonkeyRunner原理剖析》第九章-MonkeyImage实现原理 - 第二节 - ADB截屏服务
- Django框架学习笔记(12.基本知识小总结)
- python中的sys.argv[]什么意思呢。
- 阿里云CDN接入操作
- Java设计模式之建造者模式
- Unity UGUI中RectTransfrom中锚点(Anchor)、轴心(Pivot)、Rect及坐标分析
- MonkeyImage api
- Visual Studio QT5.9.2构建VTK 8.0.1
- ARToolKit编译error LNK2019: 无法解析的外部符号 ___glutInitWithExit@12,该符号在函数 _glutInit_ATEXIT_HACK@8 中被引用 解决办法
- MonkeyRunner
- krpano——背景色设置
- 关于ubuntu16.04 grub2 修复 以及开机进入grub rescue
- MySql依据多个ID查询
- 安卓日历面板选择器-选择日期区间
- java获取Object属性类型、属性名称、属性值