本文整理匯總了Golang中C.cairo_content_t函數的典型用法代碼示例。如果您正苦於以下問題:Golang cairo_content_t函數的具體用法?Golang cairo_content_t怎麽用?Golang cairo_content_t使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了cairo_content_t函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: CreateSimilar
// CreateSimilar is a wrapper around cairo_surface_create_similar().
func (v *Surface) CreateSimilar(content Content, width, height int) *Surface {
c := C.cairo_surface_create_similar(v.native(),
C.cairo_content_t(content), C.int(width), C.int(height))
s := wrapSurface(c)
runtime.SetFinalizer(s, (*Surface).destroy)
return s
}
示例2: New
//New creates a new recording surface.
//
//If extents.Empty() is true, the recording surface is unbounded.
//
//Originally cairo_recording_surface_create.
func New(content cairo.Content, extents cairo.Rectangle) Surface {
con := C.cairo_content_t(content)
extents = extents.Canon()
var s *C.cairo_surface_t
if extents.Empty() {
s = C.cairo_recording_surface_create(con, nil)
} else {
r := C.cairo_rectangle_t{
x: C.double(extents.Min.X),
y: C.double(extents.Min.Y),
width: C.double(extents.Dx()),
height: C.double(extents.Dy()),
}
s = C.cairo_recording_surface_create(con, &r)
}
return cNew(s, extents)
}
示例3: PushGroupWithContent
func (self *Surface) PushGroupWithContent(content Content) {
C.cairo_push_group_with_content(self.context, C.cairo_content_t(content))
}
示例4: PushGroupWithContent
// PushGroupWithContent is a wrapper around cairo_push_group_with_content().
func (v *Context) PushGroupWithContent(content Content) {
C.cairo_push_group_with_content(v.native(), C.cairo_content_t(content))
}
示例5:
package cairo
/*
#include <cairo.h>
#include <stdlib.h>
*/
import "C"
var (
// Content
CONTENT_COLOR = C.cairo_content_t(C.CAIRO_CONTENT_COLOR)
CONTENT_ALPHA = C.cairo_content_t(C.CAIRO_CONTENT_ALPHA)
CONTENT_COLOR_ALPHA = C.cairo_content_t(C.CAIRO_CONTENT_COLOR_ALPHA)
)
示例6: NewSurface
//NewSurface creates a script surface that records to d.
//
//Originally cairo_script_surface_create.
func (d Device) NewSurface(content cairo.Content, width, height float64) (Surface, error) {
c := C.cairo_content_t(content)
w, h := C.double(width), C.double(height)
return cNewSurf(C.cairo_script_surface_create(d.XtensionRaw(), c, w, h))
}
示例7: c
func (con Content) c() C.cairo_content_t {
return C.cairo_content_t(con)
}