add more img to bitmap examples code

This commit is contained in:
vcaesar 2021-09-08 13:46:11 -04:00
parent 3e402696be
commit 621e6b4585
2 changed files with 28 additions and 0 deletions

5
.gitignore vendored
View File

@ -84,4 +84,9 @@ vendor
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
#
examples/bitmap/test_IMG.png
examples/bitmap/imgToBitmap/test_01.png
examples/bitmap/imgToBitmap/test_002.jpeg
examples/bitmap/imgToBitmap/test_003.jpeg

View File

@ -0,0 +1,23 @@
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
"github.com/vcaesar/imgo"
)
func main() {
bit1 := robotgo.CaptureScreen(300, 300, 100, 100)
robotgo.SaveBitmap(bit1, "test_003.jpeg")
m1 := robotgo.ToImage(bit1)
fmt.Println("m1: ", m1.Bounds())
imgo.SaveToPNG("test_01.png", m1)
r1 := robotgo.ToRGBA(bit1)
fmt.Println("r1: ", r1.Pix)
bit2 := robotgo.ToCBitmap(robotgo.ImgToBitmap(m1))
robotgo.SaveBitmap(bit2, "test_002.jpeg")
}