// Screenshot returns an image.Image object containing the current screenshot.
// Currently we must.
func Screenshot() image.Image {
	C.Raw()
	defer C.Clean()

	width := int(C.Width)
	height := int(C.Height)
	stride := int(C.Stride)
	data := (*[1 << 30]byte)(unsafe.Pointer(C.data))[0 : height*stride]
	return ConvertWinBGRAToRGBA(width, height, stride, data)
}
// Screenshot returns an image.Image object containing the current screenshot.
func Screenshot() image.Image {
	C.Raw()
	defer C.Clean()

	data := (*[1 << 30]byte)(unsafe.Pointer(C.Data()))[0:C.Length()]
	width := int(C.width)
	height := int(C.height)
	stride := int(C.stride)
	return ConvertMacBGRAToRGBA(width, height, stride, data)
}
示例#3
0
func Clean() {
	C.Clean()
}