• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang glib.ObjectFromNative函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/mattn/go-gtk/glib.ObjectFromNative函数的典型用法代码示例。如果您正苦于以下问题:Golang ObjectFromNative函数的具体用法?Golang ObjectFromNative怎么用?Golang ObjectFromNative使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ObjectFromNative函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: GetPixbuf

func (v Loader) GetPixbuf() *Pixbuf {
	gpixbuf := C.gdk_pixbuf_loader_get_pixbuf(v.GPixbufLoader)
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:7,代码来源:gdkpixbuf.go


示例2: RotateSimple

func RotateSimple(p *Pixbuf, angle PixbufRotation) *Pixbuf {
	gpixbuf := C.gdk_pixbuf_rotate_simple(p.GPixbuf, C.GdkPixbufRotation(angle))
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:7,代码来源:gdkpixbuf.go


示例3: Flip

func Flip(p *Pixbuf, horizontal bool) *Pixbuf {
	gpixbuf := C.gdk_pixbuf_flip(p.GPixbuf, gbool(horizontal))
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:7,代码来源:gdkpixbuf.go


示例4: ScaleSimple

func ScaleSimple(p *Pixbuf, width, height int, interp InterpType) *Pixbuf {
	gpixbuf := C.gdk_pixbuf_scale_simple(p.GPixbuf, C.int(width), C.int(height), C.GdkInterpType(interp))
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:7,代码来源:gdkpixbuf.go


示例5: NewPixbufFromXpmData

func NewPixbufFromXpmData(data **byte) (*Pixbuf, *glib.Error) {
	var err *C.GError
	gpixbuf := C.gdk_pixbuf_new_from_xpm_data(
		(**C.char)(unsafe.Pointer(data)),
	)
	if err != nil {
		return nil, glib.ErrorFromNative(unsafe.Pointer(err))
	}
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}, nil
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:13,代码来源:gdkpixbuf.go


示例6: NewPixbufFromFileAtScale

func NewPixbufFromFileAtScale(filename string, width, height int, preserve_aspect_ratio bool) (*Pixbuf, *glib.Error) {
	var err *C.GError
	ptr := C.CString(filename)
	defer cfree(ptr)
	gpixbuf := C.gdk_pixbuf_new_from_file_at_scale(ptr, C.int(width), C.int(height), gbool(preserve_aspect_ratio), &err)
	if err != nil {
		return nil, glib.ErrorFromNative(unsafe.Pointer(err))
	}
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}, nil
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:13,代码来源:gdkpixbuf.go


示例7: NewPixbufFromFile

func NewPixbufFromFile(filename string) (*Pixbuf, *glib.Error) {
	var err *C.GError
	ptr := C.CString(filename)
	defer cfree(ptr)
	gpixbuf := C.gdk_pixbuf_new_from_file(ptr, &err)
	if err != nil {
		return nil, glib.ErrorFromNative(unsafe.Pointer(err))
	}
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}, nil
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:13,代码来源:gdkpixbuf.go


示例8: NewPixbuf

// File Loading
// GdkPixbuf * gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height);
func NewPixbuf(colorspace Colorspace, hasAlpha bool, bitsPerSample, width, height int) *Pixbuf {
	gpixbuf := C.gdk_pixbuf_new(
		C.GdkColorspace(colorspace),
		gbool(hasAlpha),
		C.int(bitsPerSample),
		C.int(width),
		C.int(height),
	)

	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:16,代码来源:gdkpixbuf.go


示例9: NewFromFileAtSize

func NewFromFileAtSize(path string, imgW int, imgH int) (pixbuf *Pixbuf, err **glib.Error) {
	var error *C.GError
	ptr := C.CString(path)
	defer C.free_string(ptr)
	gpixbuf := C.gdk_pixbuf_new_from_file_at_size(ptr, C.int(imgW), C.int(imgH), &error)
	pixbuf = &Pixbuf{
		GPixbuf: gpixbuf,
		GObject: glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
	if err != nil && error != nil {
		*err = glib.ErrorFromNative(unsafe.Pointer(error))
	}
	return
}
开发者ID:kissthink,项目名称:go-gtk,代码行数:14,代码来源:gdkpixbuf.go


示例10: Scale

func Scale(p *Pixbuf, x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) *Pixbuf {
	var gpixbuf *C.GdkPixbuf
	C.gdk_pixbuf_scale(
		p.GPixbuf,
		gpixbuf,
		C.int(x), C.int(y),
		C.int(width), C.int(height),
		C.double(offsetX), C.double(offsetY),
		C.double(scaleX), C.double(scaleY),
		C.GdkInterpType(interp))
	return &Pixbuf{
		GdkPixbuf: &GdkPixbuf{gpixbuf},
		GObject:   glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
}
开发者ID:hauke96,项目名称:go-gtk,代码行数:15,代码来源:gdkpixbuf.go


示例11: NewFromFileAtSize

func NewFromFileAtSize(filename string, width, heigth int) (*Pixbuf, *glib.Error) {
	var error *C.GError
	ptr := C.CString(filename)
	defer cfree(ptr)
	gpixbuf := C.gdk_pixbuf_new_from_file_at_size(ptr, C.int(width), C.int(heigth), &error)
	if error != nil {
		err := glib.ErrorFromNative(unsafe.Pointer(error))
		return nil, err
	}
	pixbuf := &Pixbuf{
		GPixbuf: gpixbuf,
		GObject: glib.ObjectFromNative(unsafe.Pointer(gpixbuf)),
	}
	return pixbuf, nil
}
开发者ID:nieware,项目名称:go-gtk,代码行数:15,代码来源:gdkpixbuf.go



注:本文中的github.com/mattn/go-gtk/glib.ObjectFromNative函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang glib.GValue类代码示例发布时间:2022-05-23
下一篇:
Golang glib.ErrorFromNative函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap