不知道是否能支持透明背景模式,指定特定像素为透明背景,可以匹配白点或黑点
类似于
ImageSearch的*TransN模式
*TransN: 此选项通过指定图像内的某种颜色能匹配屏幕上的任何颜色, 使得更容易找到匹配. 它常用于寻找含有透明区域的 PNG, GIF 和 TIF 文件(然而, 对于图标则不需要此选项, 因为它们的透明度是自动支持的). 对于 GIF 文件, *TransWhite 很可能会有用. 对于 PNG 和 TIF 文件, *TransBlack 可能是最佳的. 否则, 指定 N 为其他颜色名称或 RGB 值(请参阅颜色图表进行了解或使用 PixelGetColor 的 RGB 模式). 例如: *TransBlack, *TransFFFFAA, *Trans0xFFFFAA.
例如用
*表示透明背景
可以匹配以下目标
但是不会匹配以下目标
这是目前仅通过设置
err0为1做不到的
一个实际的例子是,匹配某游戏道具图标,它在右下角有数量显示,并且仅通过裁剪不包含数量的矩形区域化,无法与其他类似道具区分开
比如道具ABCD分别为(假设右下角4个像素为数量显示)
Code: Select all
__0000_ __000_0 __000_0 __00000
__0____ __0____ __0____ __0__0_
_0___00 __0__00 _0___00 __00_00
__0__00 __0__00 __0__00 __0__00
显然如果不包含数量区域,无论截取哪个部分区域,都可能无法区分道具AB或者道具BC;如果截取整个图形,把数量区域改为背景,并且取err0=1,又会匹配到道具D
但如果支持透明区域(以
*表示),事情就简单了,道具ABCD的匹配图形分别为
Code: Select all
__0000_ __000_0 __000_0 __00000
__0____ __0____ __0____ __0__0_
_0___** __0__** _0___** __00_**
__0__** __0__** __0__** __0__**
https://translate.google.com/
I don’t know if it can support the transparent background mode, specify a specific pixel as a transparent background, you can match the white point or black point
*TransN mode similar to ImageSearch
*TransN: This option can match any color on the screen by specifying a certain color in the image, making it easier to find a match. It is often used to find PNG, GIF and TIF files that contain transparent areas (however, this is not required for icons Option, because their transparency is automatically supported). For GIF files, *TransWhite is likely to be useful. For PNG and TIF files, *TransBlack may be the best. Otherwise, specify N as another color name or RGB value (please Refer to the color chart for understanding or use the RGB mode of PixelGetColor). For example: *TransBlack, *TransFFFFAA, *Trans0xFFFFAA.
For example, use * to indicate a transparent background
Code: Select all-Toggle Line numbers
_0_
_*_
_0_
_0_
Can match the following goals
Code: Select all-Toggle Line numbers
_0_ _0_
___ _0_
_0_ _0_
_0_ _0_
But will not match the following targets
Code: Select all-Toggle Line numbers
00_ _0_
___ _0_
_0_ _0_
_0_ 000
This is currently impossible to do only by setting err0 to 1.
A practical example is to match a certain game prop icon, which has a quantity displayed in the lower right corner, and only by cropping a rectangular area that does not contain the quantity, it cannot be distinguished from other similar props.
For example, the props ABCD are respectively (assuming that 4 pixels in the lower right corner are the number display)
Code: Select all-Toggle Line numbers
__0000_ __000_0 __000_0 __00000
__0____ __0____ __0____ __0__0_
_0___00 __0__00 _0___00 __00_00
__0__00 __0__00 __0__00 __0__00
Obviously if the quantity area is not included, no matter which part of the area is intercepted, it may not be able to distinguish between the props AB and the props BC; if the whole figure is intercepted, the quantity area is changed to the background, and err0=1, it will be matched to the prop D
But if it supports transparent areas (indicated by *), things are simple, the matching graphics of props ABCD are respectively
Code: Select all-Toggle Line numbers
__0000_ __000_0 __000_0 __00000
__0____ __0____ __0____ __0__0_
_0___** __0__** _0___** __00_**
__0__** __0__** __0__** __0__**