Skip to content

Commit f1db2ed

Browse files
authored
Merge pull request #671 from go-vgo/bitmap-pr
Update: add svae capture and update go mod
2 parents 63eb594 + d90493e commit f1db2ed

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/robotn/xgbutil v0.0.0-20190912154524-c861d6f87770
1010
github.com/tailscale/win v0.0.0-20240403170916-6580b55d49ca
1111
github.com/vcaesar/gops v0.40.0
12-
github.com/vcaesar/imgo v0.40.1
12+
github.com/vcaesar/imgo v0.40.2
1313
github.com/vcaesar/keycode v0.10.1
1414
github.com/vcaesar/tt v0.20.1
1515
)
@@ -28,7 +28,7 @@ require (
2828
github.com/tklauser/go-sysconf v0.3.12 // indirect
2929
github.com/tklauser/numcpus v0.6.1 // indirect
3030
github.com/yusufpapurcu/wmi v1.2.4 // indirect
31-
golang.org/x/image v0.17.0 // indirect
31+
golang.org/x/image v0.18.0 // indirect
3232
golang.org/x/sys v0.20.0 // indirect
3333
)
3434

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F
6060
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
6161
github.com/vcaesar/gops v0.40.0 h1:I+1RCGiV+LkZJUYNzAd373xs0uM2UyeFdZBmow8HfCM=
6262
github.com/vcaesar/gops v0.40.0/go.mod h1:3u/USW7JovqUK6i13VOD3qWfvXXd2TIIKE4PYIv4TOM=
63-
github.com/vcaesar/imgo v0.40.1 h1:OSX+qV8SgbVJksXXZkzfDNm6+oi2H3t8Y2Sl0QO0q70=
64-
github.com/vcaesar/imgo v0.40.1/go.mod h1:8gotN26eyM0ITbSuse0EU6GFweKW/zgfTT2fQir1qOo=
63+
github.com/vcaesar/imgo v0.40.2 h1:5GWScRLdBCMtO1v2I1bs+ZmDLZFINxYSMZ+mtUw5qPM=
64+
github.com/vcaesar/imgo v0.40.2/go.mod h1:MVCl+FxHI2gTgmiHoi0n5xNCbYcfv9SVtdEOUC92+eo=
6565
github.com/vcaesar/keycode v0.10.1 h1:0DesGmMAPWpYTCYddOFiCMKCDKgNnwiQa2QXindVUHw=
6666
github.com/vcaesar/keycode v0.10.1/go.mod h1:JNlY7xbKsh+LAGfY2j4M3znVrGEm5W1R8s/Uv6BJcfQ=
6767
github.com/vcaesar/tt v0.20.1 h1:D/jUeeVCNbq3ad8M7hhtB3J9x5RZ6I1n1eZ0BJp7M+4=
@@ -77,8 +77,8 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf
7777
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
7878
golang.org/x/exp v0.0.0-20230127140709-cafedaf64729 h1:H2kBA039yqxDv2DScpuC0knhZXO6Evfmt7mN8sGMh/4=
7979
golang.org/x/exp v0.0.0-20230127140709-cafedaf64729/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
80-
golang.org/x/image v0.17.0 h1:nTRVVdajgB8zCMZVsViyzhnMKPwYeroEERRC64JuLco=
81-
golang.org/x/image v0.17.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
80+
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
81+
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
8282
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
8383
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
8484
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=

screen.go

+10
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,13 @@ func Capture(args ...int) (*image.RGBA, error) {
5050

5151
return screenshot.Capture(x, y, w, h)
5252
}
53+
54+
// SaveCapture capture screen and save the screenshot to image
55+
func SaveCapture(path string, args ...int) error {
56+
img, err := Capture(args...)
57+
if err != nil {
58+
return err
59+
}
60+
61+
return Save(img, path)
62+
}

0 commit comments

Comments
 (0)