mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
add ToCBitmap example to examples
This commit is contained in:
parent
3dce490b76
commit
fe836c3aae
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,6 +9,7 @@ examples/bitmap/test.png
|
||||
examples/bitmap/test2.png
|
||||
examples/bitmap/test.tif
|
||||
examples/bitmap/test31.tif
|
||||
examples/bitmap/tocbitmap.png
|
||||
test/test.png
|
||||
|
||||
# Debug files
|
||||
@ -66,4 +67,3 @@ _testmain.go
|
||||
|
||||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
|
||||
.glide/
|
||||
|
||||
|
@ -35,6 +35,10 @@ func main() {
|
||||
gbit := robotgo.ToBitmap(bitmap)
|
||||
fmt.Println("go bitmap", gbit, gbit.Width)
|
||||
|
||||
cbit := robotgo.ToCBitmap(gbit)
|
||||
log.Println("cbit == bitmap: ", cbit == bitmap)
|
||||
robotgo.SaveBitmap(cbit, "tocbitmap.png")
|
||||
|
||||
// find the color in bitmap
|
||||
color := robotgo.GetColor(bitmap, 1, 2)
|
||||
fmt.Println("color...", color)
|
||||
|
@ -178,6 +178,10 @@ func bitmap() {
|
||||
gbit := robotgo.ToBitmap(bitmap)
|
||||
fmt.Println("go bitmap", gbit, gbit.Width)
|
||||
|
||||
cbit := robotgo.ToCBitmap(gbit)
|
||||
log.Println("cbit == bitmap: ", cbit == bitmap)
|
||||
robotgo.SaveBitmap(cbit, "tocbtimap.png")
|
||||
|
||||
// find the color in bitmap
|
||||
color := robotgo.GetColor(bitmap, 1, 2)
|
||||
fmt.Println("color...", color)
|
||||
|
Loading…
Reference in New Issue
Block a user