Method Cairo.Surface()->create_similar()


Method create_similar

Surface create_similar(int content, int width, int height)

Description

Create a new surface that is as compatible as possible with this surface. For example the new surface will have the same device scale, fallback resolution and font options as this. Generally, the new surface will also use the same backend, unless that is not possible for some reason.

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

Use create_similar_image() if you need an image surface which can be painted quickly to the target surface.

Parameter content

the content for the new surface

Parameter width

width of the new surface, (in device-space units)

Parameter height

height of the new surface (in device-space units)

Returns

a newly allocated surface.