Package: gdk

Function gdk:surface-create-similar-surface

Lambda List

gdk:surface-create-similar-surface (surface content width height)

Arguments

surface -- a gdk:surface object to make the new surface similar to
content -- a cairo:content-t value for the content of the new surface
width -- an integer with the width of the new surface
height -- an integer with the height of the new surface

Return Value

A newly allocated cairo:surface-t instance. The caller owns the surface and should call the cairo:surface-destroy function when done with it. This function always returns a valid pointer, but it will return a "nil" surface if the surface is in an error state.

Details

Creates a new surface that is as compatible as possible with the given surface. For example the new surface will have the same fallback resolution and font options as surface. Generally, the new surface will also use the same backend as surface, unless that is not possible for some reason. The type of the returned surface may be examined with the cairo:surface-type function.

Initially the surface contents are all 0, transparent if contents have transparency, black otherwise.

Warning

The gdk:surface-create-similar-surface function is depreacted since 4.12. Create a suitable Cairo image surface yourself.
 

See also

#2024-1-8