Beispiel #1
0
func main() {
	fmt.Println("Hello World!")
	text := C.CString("Hello World!")
	defer C.free(unsafe.Pointer(text))
	C.cvNamedWindow(text, 1)
	img := unsafe.Pointer(C.cvCreateImage(C.cvSize(640, 480), C.IPL_DEPTH_8U, 1))
	C.cvSet(img, C.cvScalar(0, 0, 0, 0), nil)
	var font C.CvFont
	C.cvInitFont(&font, C.CV_FONT_HERSHEY_SIMPLEX|C.CV_FONT_ITALIC,
		1.0, 1.0, 0, 1, 8)
	C.cvPutText(img, text, C.cvPoint(200, 400), &font,
		C.cvScalar(255, 255, 0, 0))
	C.cvShowImage(text, img)
	C.cvWaitKey(0)
}
Beispiel #2
0
/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
func WaitKey(delay int) int {
	key := C.cvWaitKey(C.int(delay))
	return int(key)
}
Beispiel #3
0
func WaitKey(miliseconds int) rune {
	key := C.cvWaitKey(C.int(miliseconds))
	return rune(key)
}