Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# bitmap

## Use

```Go
package main

import (
"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")
}
```