utils

package module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

go-utils

基于golang开发的go-utils-dll的套件

Documentation

Index

Constants

View Source
const (
	Linear   = "LinearCompute"
	Magnetic = "MagneticCompute"
	Pid      = "PidCompute"
	Speed    = "SpeedCompute"
)

Variables

This section is empty.

Functions

func BitmapSaveBMP added in v1.0.4

func BitmapSaveBMP(path string) (err error)

保存bmp

func CaptureBitmap added in v1.0.3

func CaptureBitmap(data *[]byte) (err error)

捕获bitmap

func CaptureInit added in v1.0.3

func CaptureInit(hwnd, x, y, width, height int32) (err error)

捕获初始化

func CaptureRelease added in v1.0.3

func CaptureRelease() (err error)

捕获释放

func Compute

func Compute(name string, currentX, currentY, targetX, targetY float64) (outputX, outputY float64, err error)

算法

func GetCursorPos

func GetCursorPos() (currentX, currentY float64, err error)

获取鼠标当前移动速度

func GetHwndByTitle

func GetHwndByTitle(title string) (hwnd int32, err error)

通过窗口标题获取窗口句柄

func GetScreenResolution

func GetScreenResolution() (width, height int32, err error)

获取屏幕分辨率

func IsWindowIconic added in v1.0.3

func IsWindowIconic(hwnd int32) bool

通过窗口句柄判断窗口是否最小化

func IsWindowVisible added in v1.0.3

func IsWindowVisible(hwnd int32) bool

通过窗口句柄判断窗口是否最小化

func LinearInit

func LinearInit(t float64) (err error)

线性算法初始化

func MagneticInit

func MagneticInit(k float64) (err error)

磁吸算法初始化

func MoveMouse

func MoveMouse(dx, dy float64) (err error)

根据鼠标当前位置移动

func PidInit

func PidInit(p, i, d float64) (err error)

PID算法初始化

func SpeedInit

func SpeedInit(speed, deltaTime float64) (err error)

加速度算法初始化

Types

type Rect added in v1.0.1

type Rect struct {
	Width, Height int32
}

func GetWindowRect added in v1.0.1

func GetWindowRect(hwnd int32) (rect Rect, err error)

通过窗口句柄获取窗口RECT

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL