Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vcaesar/bitmap
Bitmap, robotgo bitmap function
https://github.com/vcaesar/bitmap
bitmap image robotgo
Last synced: 3 months ago
JSON representation
Bitmap, robotgo bitmap function
- Host: GitHub
- URL: https://github.com/vcaesar/bitmap
- Owner: vcaesar
- License: apache-2.0
- Created: 2022-01-01T19:47:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-16T18:44:18.000Z (5 months ago)
- Last Synced: 2024-08-16T20:02:08.522Z (5 months ago)
- Topics: bitmap, image, robotgo
- Language: C
- Homepage:
- Size: 583 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# bitmap
## Use
```Go
package mainimport (
"fmt""github.com/go-vgo/robotgo"
"github.com/vcaesar/bitmap"
)func main() {
bit := robotgo.CaptureScreen(10, 20, 30, 40)
// use `defer robotgo.FreeBitmap(bit)` to free the bitmap
defer robotgo.FreeBitmap(bit)fmt.Println("bitmap...", bit)
img := robotgo.ToImage(bit)
// robotgo.SavePng(img, "test_1.png")
robotgo.Save(img, "test_1.png")bit2 := robotgo.ToCBitmap(robotgo.ImgToBitmap(img))
fx, fy := bitmap.Find(bit2)
fmt.Println("FindBitmap------ ", fx, fy)
robotgo.Move(fx, fy)arr := bitmap.FindAll(bit2)
fmt.Println("Find all bitmap: ", arr)fx, fy = bitmap.Find(bit)
fmt.Println("FindBitmap------ ", fx, fy)bitmap.Save(bit, "test.png")
}
```