ms-types 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/types/image.d.ts
CHANGED
|
@@ -110,15 +110,11 @@ declare namespace image {
|
|
|
110
110
|
* @param imageId 图片id
|
|
111
111
|
* @param points 颜色点
|
|
112
112
|
* @param threshold 阈值 0.0-1.0
|
|
113
|
-
* @param x 左上角x 全屏传0
|
|
114
|
-
* @param y 左上角y 全屏传0
|
|
115
|
-
* @param ex 右下角x 全屏传0
|
|
116
|
-
* @param ey 右下角y 全屏传0
|
|
117
113
|
* @returns true 相同 false 不同
|
|
118
114
|
* @example
|
|
119
115
|
* const imageId = image.readImage("screen.jpg")
|
|
120
116
|
* if (imageId) {
|
|
121
|
-
* const isSame = image.cmpColor(imageId, "1|2|#6DD1E6-#101010", 0.9
|
|
117
|
+
* const isSame = image.cmpColor(imageId, "1|2|#6DD1E6-#101010", 0.9)
|
|
122
118
|
* if (isSame) {
|
|
123
119
|
* logi("颜色相同")
|
|
124
120
|
* }
|
|
@@ -127,11 +123,7 @@ declare namespace image {
|
|
|
127
123
|
function cmpColor(
|
|
128
124
|
imageId: string,
|
|
129
125
|
points: string,
|
|
130
|
-
threshold: number
|
|
131
|
-
x: number,
|
|
132
|
-
y: number,
|
|
133
|
-
ex: number,
|
|
134
|
-
ey: number
|
|
126
|
+
threshold: number
|
|
135
127
|
): boolean;
|
|
136
128
|
/**
|
|
137
129
|
* 查找颜色
|
|
@@ -352,7 +344,11 @@ declare namespace image {
|
|
|
352
344
|
* }
|
|
353
345
|
* image.release(imageId)
|
|
354
346
|
*/
|
|
355
|
-
function toBase64Format(
|
|
347
|
+
function toBase64Format(
|
|
348
|
+
imageId: string,
|
|
349
|
+
format: string,
|
|
350
|
+
q: number
|
|
351
|
+
): string | null;
|
|
356
352
|
/**
|
|
357
353
|
* 扫描条码 支持一维码和二维码
|
|
358
354
|
* @param imageId 图片id
|
package/types/utils.d.ts
CHANGED
|
@@ -111,30 +111,18 @@ declare namespace $图片 {
|
|
|
111
111
|
* @param 图片ID 图片id
|
|
112
112
|
* @param 颜色点 颜色点 格式为"x1,y1|#6DD1E6-#101010,x2,y2|#6DD1E6-#101010"
|
|
113
113
|
* @param 阈值 0.0-1.0
|
|
114
|
-
* @param 区域左上角x 全屏传0
|
|
115
|
-
* @param 区域左上角y 全屏传0
|
|
116
|
-
* @param 区域右下角x 全屏传0
|
|
117
|
-
* @param 区域右下角y 全屏传0
|
|
118
114
|
* @returns true 相同 false 不同
|
|
119
115
|
* @example
|
|
120
116
|
* const 图片ID = $图片.读取图片("screen.jpg")
|
|
121
117
|
* if (图片ID) {
|
|
122
|
-
* const isSame = $图片.多点比色(图片ID, "1|2|#6DD1E6-#101010", 0.9
|
|
118
|
+
* const isSame = $图片.多点比色(图片ID, "1|2|#6DD1E6-#101010", 0.9)
|
|
123
119
|
* if (isSame) {
|
|
124
120
|
* $打印信息日志("颜色相同")
|
|
125
121
|
* }
|
|
126
122
|
* }
|
|
127
123
|
* $图片.释放图片(图片ID)
|
|
128
124
|
*/
|
|
129
|
-
function 多点比色(
|
|
130
|
-
图片ID: 字符串,
|
|
131
|
-
颜色点: 字符串,
|
|
132
|
-
阈值: 数字,
|
|
133
|
-
区域左上角x: 数字,
|
|
134
|
-
区域左上角y: 数字,
|
|
135
|
-
区域右下角x: 数字,
|
|
136
|
-
区域右下角y: 数字
|
|
137
|
-
): 布尔值;
|
|
125
|
+
function 多点比色(图片ID: 字符串, 颜色点: 字符串, 阈值: 数字): 布尔值;
|
|
138
126
|
/**
|
|
139
127
|
* 查找颜色
|
|
140
128
|
* @param 图片ID 图片id
|
|
@@ -354,7 +342,11 @@ declare namespace $图片 {
|
|
|
354
342
|
* }
|
|
355
343
|
* $图片.释放图片(图片ID)
|
|
356
344
|
*/
|
|
357
|
-
function 图片转base64(
|
|
345
|
+
function 图片转base64(
|
|
346
|
+
图片ID: 字符串,
|
|
347
|
+
格式: 字符串,
|
|
348
|
+
质量: 数字
|
|
349
|
+
): 字符串 | null;
|
|
358
350
|
/**
|
|
359
351
|
* 扫描条码 支持一维码和二维码
|
|
360
352
|
* @param 图片ID 图片ID
|