加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
graphicColor.go 9.43 KB
一键复制 编辑 原始数据 按行查看 历史
// 图色
package dmsoft
import (
ole "github.com/go-ole/go-ole"
)
func (com *Dmsoft) AppendPicAddr(picInfo string, addr, size int) string {
ret, _ := com.dm.CallMethod("AppendPicAddr", picInfo, addr, size)
return ret.ToString()
}
func (com *Dmsoft) Capture(x1, y1, x2, y2 int, file string) int {
ret, _ := com.dm.CallMethod("Capture", x1, y1, x2, y2, file)
return int(ret.Val)
}
func (com *Dmsoft) CaptureGif(x1, y1, x2, y2 int, file string, delay, time int) int {
ret, _ := com.dm.CallMethod("CaptureGif", x1, y1, x2, y2, file, delay, time)
return int(ret.Val)
}
func (com *Dmsoft) CaptureJpg(x1, y1, x2, y2 int, file string, quality int) int {
ret, _ := com.dm.CallMethod("CaptureJpg", x1, y1, x2, y2, file, quality)
return int(ret.Val)
}
func (com *Dmsoft) CapturePng(x1, y1, x2, y2 int, file string) int {
ret, _ := com.dm.CallMethod("CapturePng", x1, y1, x2, y2, file)
return int(ret.Val)
}
func (com *Dmsoft) CapturePre(file string) int {
ret, _ := com.dm.CallMethod("CapturePre", file)
return int(ret.Val)
}
func (com *Dmsoft) CmpColor(x int, y int, color string, sim float32) int {
ret, _ := com.dm.CallMethod("CmpColor", x, y, color, sim)
return int(ret.Val)
}
func (com *Dmsoft) EnableDisplayDebug(enableDebug int) int {
ret, _ := com.dm.CallMethod("EnableDisplayDebug", enableDebug)
return int(ret.Val)
}
func (com *Dmsoft) EnableFindPicMultithread(enable int) int {
ret, _ := com.dm.CallMethod("EnableFindPicMultithread", enable)
return int(ret.Val)
}
func (com *Dmsoft) EnableGetColorByCapture(enable int) int {
ret, _ := com.dm.CallMethod("EnableGetColorByCapture", enable)
return int(ret.Val)
}
func (com *Dmsoft) FindColor(x1, y1, x2, y2 int, color string, sim float32, dir int, intX *int, intY *int) int {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindColor", x1, y1, x2, y2, color, sim, dir, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return int(ret.Val)
}
func (com *Dmsoft) FindColorBlock(x1, y1, x2, y2 int, color string, sim float32, count, width, height int, intX, intY *int) int {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindColorBlock", x1, y1, x2, y2, color, sim, count, width, height, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return int(ret.Val)
}
func (com *Dmsoft) FindColorBlockEx(x1, y1, x2, y2 int, color string, sim float32, count, width, height int) string {
ret, _ := com.dm.CallMethod("FindColorBlockEx", x1, y1, x2, y2, color, sim, count, width, height)
return ret.ToString()
}
func (com *Dmsoft) FindColorE(x1, y1, x2, y2 int, color string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindColorE", x1, y1, x2, y2, color, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindColorEx(x1, y1, x2, y2 int, color string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindColorEx", x1, y1, x2, y2, color, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindMulColor(x1, y1, x2, y2 int, color string, sim float32) int {
ret, _ := com.dm.CallMethod("FindMulColor", x1, y1, x2, y2, color, sim)
return int(ret.Val)
}
func (com *Dmsoft) FindMultiColor(x1, y1, x2, y2 int, firstColor string, offsetColor string, sim float32, dir int, intX, intY *int) int {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindMultiColor", x1, y1, x2, y2, firstColor, offsetColor, sim, dir, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return int(ret.Val)
}
func (com *Dmsoft) FindMultiColorE(x1, y1, x2, y2 int, firstColor string, offsetColor string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindMultiColorE", x1, y1, x2, y2, firstColor, offsetColor, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindMultiColorEx(x1, y1, x2, y2 int, firstColor string, offsetColor string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindMultiColorEx", x1, y1, x2, y2, firstColor, offsetColor, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindPic(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int, intX, intY *int) int {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindPic", x1, y1, x2, y2, picName, deltaColor, sim, dir, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return int(ret.Val)
}
func (com *Dmsoft) FindPicE(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindPicE", x1, y1, x2, y2, picName, deltaColor, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindPicEx(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindPicEx", x1, y1, x2, y2, picName, deltaColor, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindPicExS(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int) string {
ret, _ := com.dm.CallMethod("FindPicExS", x1, y1, x2, y2, picName, deltaColor, sim, dir)
return ret.ToString()
}
func (com *Dmsoft) FindPicMem(x1, y1, x2, y2 int, pic_info, delta_color string, sim float32, dir int, intX, intY *int) int {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindPicMem", x1, y1, x2, y2, pic_info, delta_color, sim, dir, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return int(ret.Val)
}
// func (com *Dmsoft)FindPicMemE(x1, y1, x2, y2, pic_info, delta_color,sim, dir,intX, intY) string{}
// func (com *Dmsoft)FindPicMemEx(x1, y1, x2, y2, pic_info, delta_color,sim, dir,intX, intY) string{}
func (com *Dmsoft) FindPicS(x1, y1, x2, y2 int, picName string, deltaColor string, sim float32, dir int, intX, intY *int) string {
x := ole.NewVariant(ole.VT_I4, 0)
y := ole.NewVariant(ole.VT_I4, 0)
ret, _ := com.dm.CallMethod("FindPicS", x1, y1, x2, y2, picName, deltaColor, sim, dir, &x, &y)
*intX = int(x.Val)
*intY = int(y.Val)
x.Clear()
y.Clear()
return ret.ToString()
}
// func (com *Dmsoft)FindShape(x1, y1, x2, y2, offset_color,sim, dir,intX,intY) int{}
// func (com *Dmsoft)FindShapeE(x1, y1, x2, y2, offset_color,sim, dir,intX,intY) string{}
// func (com *Dmsoft)FindShapeEx(x1, y1, x2, y2, offset_color,sim, dir,intX,intY) string{}
func (com *Dmsoft) FreePic(pic_name string) int {
ret, _ := com.dm.CallMethod("FreePic", pic_name)
return int(ret.Val)
}
func (com *Dmsoft) GetAveHSV(x1, y1, x2, y2 int) string {
ret, _ := com.dm.CallMethod("GetAveHSV", x1, y1, x2, y2)
return ret.ToString()
}
func (com *Dmsoft) GetAveRGB(x1, y1, x2, y2 int) string {
ret, _ := com.dm.CallMethod("GetAveRGB", x1, y1, x2, y2)
return ret.ToString()
}
func (com *Dmsoft) GetColor(x, y int) string {
ret, _ := com.dm.CallMethod("GetColor", x, y)
return ret.ToString()
}
func (com *Dmsoft) GetColorBGR(x, y int) string {
ret, _ := com.dm.CallMethod("GetColorBGR", x, y)
return ret.ToString()
}
func (com *Dmsoft) GetColorHSV(x, y int) string {
ret, _ := com.dm.CallMethod("GetColorHSV", x, y)
return ret.ToString()
}
func (com *Dmsoft) GetColorNum(x1, y1, x2, y2 int, color string, sim float32) int {
ret, _ := com.dm.CallMethod("GetColorNum", x1, y1, x2, y2, color, sim)
return int(ret.Val)
}
func (com *Dmsoft) GetPicSize(picName string) string {
ret, _ := com.dm.CallMethod("GetPicSize", picName)
return ret.ToString()
}
func (com *Dmsoft) GetScreenData(x1, y1, x2, y2 int) int {
ret, _ := com.dm.CallMethod("GetScreenData", x1, y1, x2, y2)
return int(ret.Val)
}
func (com *Dmsoft) GetScreenDataBmp(x1, y1, x2, y2 int, data, size *int) int {
d := ole.NewVariant(ole.VT_I4, int64(*data))
s := ole.NewVariant(ole.VT_I4, int64(*size))
ret, _ := com.dm.CallMethod("GetScreenDataBmp", x1, y1, x2, y2, &d, &s)
*data = int(d.Val)
*size = int(s.Val)
d.Clear()
s.Clear()
return int(ret.Val)
}
func (com *Dmsoft) ImageToBmp(pic_name, bmp_name string) int {
ret, _ := com.dm.CallMethod("ImageToBmp", pic_name, bmp_name)
return int(ret.Val)
}
func (com *Dmsoft) IsDisplayDead(x1, y1, x2, y2, time int) int {
ret, _ := com.dm.CallMethod("IsDisplayDead", x1, y1, x2, y2, time)
return int(ret.Val)
}
func (com *Dmsoft) LoadPic(pic_name string) int {
ret, _ := com.dm.CallMethod("LoadPic", pic_name)
return int(ret.Val)
}
func (com *Dmsoft) LoadPicByte(addr, size int, pic_name string) int {
ret, _ := com.dm.CallMethod("LoadPicByte", addr, size, pic_name)
return int(ret.Val)
}
func (com *Dmsoft) MatchPicName(picName string) string {
ret, _ := com.dm.CallMethod("MatchPicName", picName)
return ret.ToString()
}
func (com *Dmsoft) SetExcludeRegion(mode int, info string) int {
ret, _ := com.dm.CallMethod("SetExcludeRegion", mode, info)
return int(ret.Val)
}
func (com *Dmsoft) SetPicPwd(pwd string) int {
ret, _ := com.dm.CallMethod("SetExcludeRegion", pwd)
return int(ret.Val)
}
func (com *Dmsoft) RGB2BGR(rgb_color string) string {
ret, _ := com.dm.CallMethod("RGB2BGR", rgb_color)
return ret.ToString()
}
func (com *Dmsoft) BGR2RGB(bgr_color string) string {
ret, _ := com.dm.CallMethod("BGR2RGB", bgr_color)
return ret.ToString()
}
func (com *Dmsoft) SetFindPicMultithreadCount(count int) int {
ret, _ := com.dm.CallMethod("SetFindPicMultithreadCount", count)
return int(ret.Val)
}
func (com *Dmsoft) SetFindPicMultithreadLimit(limit int) int {
ret, _ := com.dm.CallMethod("SetFindPicMultithreadLimit", limit)
return int(ret.Val)
}
// 增加了接口FindPicSim FindPicSimEx FindPicSimE和FindPicSimMem FindPicSimMemEx FindPicSimMemE
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化