Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# IDE tool cache
.idea/*
.vscode/*
3 changes: 3 additions & 0 deletions windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func Capture(x, y, width, height int) (*image.RGBA, error) {
}
defer win.SelectObject(memory_device, old)

if x == width || y == height {
return nil, errors.New("size failed (width or height are consistent)")
}
if !win.BitBlt(memory_device, 0, 0, int32(width), int32(height), hdc, int32(x), int32(y), win.SRCCOPY) {
return nil, errors.New("BitBlt failed")
}
Expand Down