mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
add more img to bitmap examples code
This commit is contained in:
parent
3e402696be
commit
621e6b4585
5
.gitignore
vendored
5
.gitignore
vendored
@ -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
|
||||
|
23
examples/bitmap/imgToBitmap/main.go
Normal file
23
examples/bitmap/imgToBitmap/main.go
Normal 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")
|
||||
}
|
Loading…
Reference in New Issue
Block a user