예제 #1
0
파일: gdk.go 프로젝트: raichu/gotk3
// PixbufGetFileInfo is a wrapper around gdk_pixbuf_get_file_info().
// TODO: need to wrap the returned format to GdkPixbufFormat.
func PixbufGetFileInfo(filename string) (format interface{}, width, height int) {
	cstr := C.CString(filename)
	defer C.free(unsafe.Pointer(cstr))
	var cw, ch C.gint
	format = C.gdk_pixbuf_get_file_info((*C.gchar)(cstr), &cw, &ch)
	// TODO: need to wrap the returned format to GdkPixbufFormat.
	return format, int(cw), int(ch)
}
예제 #2
0
파일: gdkpixbuf.go 프로젝트: hauke96/go-gtk
func GetFileInfo(filename string, width, height *int) *Format {
	ptr := C.CString(filename)
	defer cfree(ptr)

	var w, h C.gint
	format := &Format{C.gdk_pixbuf_get_file_info(gstring(ptr), &w, &h)}
	*width = int(w)
	*height = int(h)
	return format
}
예제 #3
0
파일: gdkpixbuf.go 프로젝트: arip33/go-gtk
func GetFileInfo(path string, imgW *int, imgH *int) *GdkPixbufFormat {
	ptr := C.CString(path)
	defer C.free_string(ptr)

	var w, h C.gint
	format := &GdkPixbufFormat{C.gdk_pixbuf_get_file_info(C.to_gcharptr(ptr), &w, &h)}
	*imgW = int(w)
	*imgH = int(h)
	return format
}