From fe836c3aae3a5a8b165368ef609e69750e8d62c3 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sun, 24 Jun 2018 23:45:11 +0800 Subject: [PATCH] add ToCBitmap example to examples --- .gitignore | 2 +- examples/bitmap/main.go | 4 ++++ examples/main.go | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f83994c..d776a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ - diff --git a/examples/bitmap/main.go b/examples/bitmap/main.go index b16c45f..b7c92d2 100644 --- a/examples/bitmap/main.go +++ b/examples/bitmap/main.go @@ -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) diff --git a/examples/main.go b/examples/main.go index ae910f9..9868fa8 100644 --- a/examples/main.go +++ b/examples/main.go @@ -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)