jpayne@68: jpayne@68: jpayne@68:
jpayne@68: jpayne@68:jpayne@68: Top jpayne@68: | jpayne@68:![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68:
jpayne@68: Win32 Surfacesjpayne@68:Win32 Surfaces — Microsoft Windows surface support jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_create_with_dib () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_create_with_ddb () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_create_with_format () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_printing_surface_create () jpayne@68: | jpayne@68:
jpayne@68: HDC jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_get_dc () jpayne@68: | jpayne@68:
jpayne@68: cairo_surface_t * jpayne@68: | jpayne@68:jpayne@68: cairo_win32_surface_get_image () jpayne@68: | jpayne@68:
#define | jpayne@68:CAIRO_HAS_WIN32_SURFACE | jpayne@68:
The Microsoft Windows surface is used to render cairo graphics to jpayne@68: Microsoft Windows windows, bitmaps, and printing device contexts.
jpayne@68:The surface returned by cairo_win32_printing_surface_create()
is of surface
jpayne@68: type CAIRO_SURFACE_TYPE_WIN32_PRINTING
and is a multi-page vector surface
jpayne@68: type.
The surface returned by the other win32 constructors is of surface type
jpayne@68: CAIRO_SURFACE_TYPE_WIN32
and is a raster surface type.
cairo_surface_t *
jpayne@68: cairo_win32_surface_create (HDC hdc
);
jpayne@68: Creates a cairo surface that targets the given DC. The DC will be
jpayne@68: queried for its initial clip extents, and this will be used as the
jpayne@68: size of the cairo surface. The resulting surface will always be of
jpayne@68: format CAIRO_FORMAT_RGB24
; should you need another surface format,
jpayne@68: you will need to create one through
jpayne@68: cairo_win32_surface_create_with_format()
or
jpayne@68: cairo_win32_surface_create_with_dib()
.
hdc |
jpayne@68: the DC to create a surface for |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:cairo_surface_t * jpayne@68: cairo_win32_surface_create_with_dib (jpayne@68:cairo_format_t format
, jpayne@68:int width
, jpayne@68:int height
);
Creates a device-independent-bitmap surface not associated with jpayne@68: any particular existing surface or device context. The created jpayne@68: bitmap will be uninitialized.
jpayne@68:format |
jpayne@68: format of pixels in the surface to create |
jpayne@68: jpayne@68: |
width |
jpayne@68: width of the surface, in pixels |
jpayne@68: jpayne@68: |
height |
jpayne@68: height of the surface, in pixels |
jpayne@68: jpayne@68: |
Since: 1.2
jpayne@68:cairo_surface_t * jpayne@68: cairo_win32_surface_create_with_ddb (jpayne@68:HDC hdc
, jpayne@68:cairo_format_t format
, jpayne@68:int width
, jpayne@68:int height
);
Creates a device-dependent-bitmap surface not associated with jpayne@68: any particular existing surface or device context. The created jpayne@68: bitmap will be uninitialized.
jpayne@68:hdc |
jpayne@68: a DC compatible with the surface to create |
jpayne@68: jpayne@68: |
format |
jpayne@68: format of pixels in the surface to create |
jpayne@68: jpayne@68: |
width |
jpayne@68: width of the surface, in pixels |
jpayne@68: jpayne@68: |
height |
jpayne@68: height of the surface, in pixels |
jpayne@68: jpayne@68: |
Since: 1.4
jpayne@68:cairo_surface_t * jpayne@68: cairo_win32_surface_create_with_format jpayne@68: (jpayne@68:HDC hdc
, jpayne@68:cairo_format_t format
);
Creates a cairo surface that targets the given DC. The DC will be jpayne@68: queried for its initial clip extents, and this will be used as the jpayne@68: size of the cairo surface.
jpayne@68:Supported formats are:
jpayne@68: CAIRO_FORMAT_ARGB32
jpayne@68: CAIRO_FORMAT_RGB24
Note: format
jpayne@68: only tells cairo how to draw on the surface, not what
jpayne@68: the format of the surface is. Namely, cairo does not (and cannot)
jpayne@68: check that hdc
jpayne@68: actually supports alpha-transparency.
hdc |
jpayne@68: the DC to create a surface for |
jpayne@68: jpayne@68: |
format |
jpayne@68: format of pixels in the surface to create |
jpayne@68: jpayne@68: |
Since: 1.14
jpayne@68:cairo_surface_t *
jpayne@68: cairo_win32_printing_surface_create (HDC hdc
);
jpayne@68: Creates a cairo surface that targets the given DC. The DC will be jpayne@68: queried for its initial clip extents, and this will be used as the jpayne@68: size of the cairo surface. The DC should be a printing DC; jpayne@68: antialiasing will be ignored, and GDI will be used as much as jpayne@68: possible to draw to the surface.
jpayne@68:The returned surface will be wrapped using the paginated surface to
jpayne@68: provide correct complex rendering behaviour; cairo_surface_show_page()
and
jpayne@68: associated methods must be used for correct output.
hdc |
jpayne@68: the DC to create a surface for |
jpayne@68: jpayne@68: |
Since: 1.6
jpayne@68:HDC
jpayne@68: cairo_win32_surface_get_dc (cairo_surface_t *surface
);
jpayne@68: Returns the HDC associated with this surface, or NULL
if none.
jpayne@68: Also returns NULL
if the surface is not a win32 surface.
A call to cairo_surface_flush()
is required before using the HDC to
jpayne@68: ensure that all pending drawing operations are finished and to
jpayne@68: restore any temporary modification cairo has made to its state. A
jpayne@68: call to cairo_surface_mark_dirty()
is required after the state or
jpayne@68: the content of the HDC has been modified.
surface |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.2
jpayne@68:cairo_surface_t *
jpayne@68: cairo_win32_surface_get_image (cairo_surface_t *surface
);
jpayne@68: Returns a cairo_surface_t image surface that refers to the same bits
jpayne@68: as the DIB of the Win32 surface. If the passed-in win32 surface
jpayne@68: is not a DIB surface, NULL
is returned.
surface |
jpayne@68: jpayne@68: | jpayne@68: |
a cairo_surface_t (owned by the win32 cairo_surface_t),
jpayne@68: or NULL
if the win32 surface is not a DIB.
Since: 1.4
jpayne@68: