コード例 #1
0
ファイル: surface.go プロジェクト: ungerik/go-cairo
func NewPSSurface(filename string, widthInPoints, heightInPoints float64, level PSLevel) *Surface {
	cs := C.CString(filename)
	defer C.free(unsafe.Pointer(cs))
	s := C.cairo_ps_surface_create(cs, C.double(widthInPoints), C.double(heightInPoints))
	C.cairo_ps_surface_restrict_to_level(s, C.cairo_ps_level_t(level))
	return &Surface{surface: s, context: C.cairo_create(s)}
}
コード例 #2
0
ファイル: ps.go プロジェクト: jimmyfrasche/cairo
//RestrictTo restricts the generated PostScript to the specified level.
//The default is Level3.
//
//This method should only be called before any drawing operations have been
//performed on this surface.
//
//Originally cairo_ps_surface_restrict_to_level.
func (s Surface) RestrictTo(level level) error {
	C.cairo_ps_surface_restrict_to_level(s.XtensionRaw(), level.c())
	return s.Err()
}