<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>cairomm: Cairo::Win32Surface Class Reference</title> <link href="cairomm.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceCairo.html">Cairo</a>::<a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a> </div> </div> <div class="contents"> <h1>Cairo::Win32Surface Class Reference</h1><!-- doxytag: class="Cairo::Win32Surface" --><!-- doxytag: inherits="Cairo::Surface" -->A <a class="el" href="classCairo_1_1Win32Surface.html" title="A Win32Surface provides a way to render within Microsoft Windows.">Win32Surface</a> provides a way to render within Microsoft Windows. <a href="#_details">More...</a> <p> Inherits <a class="el" href="classCairo_1_1Surface.html">Cairo::Surface</a>. <p> <p> <a href="classCairo_1_1Win32Surface-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#74e9cee0ea5f89bcc5dc7444217b1f1d">Win32Surface</a> (cairo_surface_t*<a class="el" href="classCairo_1_1Surface.html#d176eb7343b5902df3c19f9f56e59fb4">cobject</a>, bool has_reference=false)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a C++ wrapper for the C instance. <a href="#74e9cee0ea5f89bcc5dc7444217b1f1d"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#04fd3568ffc9a969d7f625f28ae1e584">~Win32Surface</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">HDC </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#cdcc018282d8cfed8bc992233a378aa4">get_dc</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the HDC associated with this surface, or NULL if none. <a href="#cdcc018282d8cfed8bc992233a378aa4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>< <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#e34550ff9da8de1739327291c73a9f73">get_image</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by...">ImageSurface</a> that refers to the same bits as the DIB of the Win32 surface. <a href="#e34550ff9da8de1739327291c73a9f73"></a><br></td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>< <a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#6e5658b32a2d2083d0fddf81428ca1fb">create</a> (HDC hdc)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a cairo surface that targets the given DC. <a href="#6e5658b32a2d2083d0fddf81428ca1fb"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>< <a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#bd2b5f85390a34531a0c40e6e6c692d8">create</a> (<a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> format, int width, int height)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>< <a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#78cfec22533db4a28356dedf7a82163e">create_with_dib</a> (<a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> format, int width, int height)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a device-independent-bitmap surface not associated with any particular existing surface or device context. <a href="#78cfec22533db4a28356dedf7a82163e"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>< <a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Win32Surface.html#8797038d60b767e538f7302e46471817">create_with_ddb</a> (HDC hdc, <a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> format, int width, int height)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a device-independent-bitmap surface not associated with any particular existing surface or device context. <a href="#8797038d60b767e538f7302e46471817"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A <a class="el" href="classCairo_1_1Win32Surface.html" title="A Win32Surface provides a way to render within Microsoft Windows.">Win32Surface</a> provides a way to render within Microsoft Windows. <p> If you want to draw to the screen within a Microsoft Windows application, you should use this <a class="el" href="classCairo_1_1Surface.html" title="A cairo surface represents an image, either as the destination of a drawing operation...">Surface</a> type.<p> <dl class="note" compact><dt><b>Note:</b></dt><dd>For this <a class="el" href="classCairo_1_1Surface.html" title="A cairo surface represents an image, either as the destination of a drawing operation...">Surface</a> to be available, cairo must have been compiled with Win32 support </dd></dl> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="74e9cee0ea5f89bcc5dc7444217b1f1d"></a><!-- doxytag: member="Cairo::Win32Surface::Win32Surface" ref="74e9cee0ea5f89bcc5dc7444217b1f1d" args="(cairo_surface_t *cobject, bool has_reference=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Cairo::Win32Surface::Win32Surface </td> <td>(</td> <td class="paramtype">cairo_surface_t * </td> <td class="paramname"> <em>cobject</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>has_reference</em> = <code>false</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Create a C++ wrapper for the C instance. <p> This C++ instance should then be given to a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr<> is a reference-counting shared smartpointer.">RefPtr</a>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>cobject</em> </td><td>The C instance. </td></tr> <tr><td valign="top"></td><td valign="top"><em>has_reference</em> </td><td>whether we already have a reference. Otherwise, the constructor will take an extra reference. </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="04fd3568ffc9a969d7f625f28ae1e584"></a><!-- doxytag: member="Cairo::Win32Surface::~Win32Surface" ref="04fd3568ffc9a969d7f625f28ae1e584" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual Cairo::Win32Surface::~Win32Surface </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="bd2b5f85390a34531a0c40e6e6c692d8"></a><!-- doxytag: member="Cairo::Win32Surface::create" ref="bd2b5f85390a34531a0c40e6e6c692d8" args="(Format format, int width, int height)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a><<a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a>> Cairo::Win32Surface::create </td> <td>(</td> <td class="paramtype"><a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> </td> <td class="paramname"> <em>format</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>height</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> <dl class="deprecated" compact><dt><b><a class="el" href="deprecated.html#_deprecated000010">Deprecated:</a></b></dt><dd>use <a class="el" href="classCairo_1_1Win32Surface.html#78cfec22533db4a28356dedf7a82163e" title="Creates a device-independent-bitmap surface not associated with any particular existing...">create_with_dib()</a> </dd></dl> </div> </div><p> <a class="anchor" name="6e5658b32a2d2083d0fddf81428ca1fb"></a><!-- doxytag: member="Cairo::Win32Surface::create" ref="6e5658b32a2d2083d0fddf81428ca1fb" args="(HDC hdc)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a><<a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a>> Cairo::Win32Surface::create </td> <td>(</td> <td class="paramtype">HDC </td> <td class="paramname"> <em>hdc</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Creates a cairo surface that targets the given DC. <p> The DC will be queried for its initial clip extents, and this will be used as the size of the cairo surface. Also, if the DC is a raster DC, it will be queried for its pixel format and the cairo surface format will be set appropriately.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hdc</em> </td><td>the DC to create a surface for. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created surface. </dd></dl> </div> </div><p> <a class="anchor" name="8797038d60b767e538f7302e46471817"></a><!-- doxytag: member="Cairo::Win32Surface::create_with_ddb" ref="8797038d60b767e538f7302e46471817" args="(HDC hdc, Format format, int width, int height)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a><<a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a>> Cairo::Win32Surface::create_with_ddb </td> <td>(</td> <td class="paramtype">HDC </td> <td class="paramname"> <em>hdc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> </td> <td class="paramname"> <em>format</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>height</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Creates a device-independent-bitmap surface not associated with any particular existing surface or device context. <p> The created bitmap will be uninitialized.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hdc</em> </td><td>the DC to create a surface for. </td></tr> <tr><td valign="top"></td><td valign="top"><em>format</em> </td><td>format of pixels in the surface to create, </td></tr> <tr><td valign="top"></td><td valign="top"><em>width</em> </td><td>width of the surface, in pixels. </td></tr> <tr><td valign="top"></td><td valign="top"><em>height</em> </td><td>height of the surface, in pixels. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created surface.</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd>1.8 </dd></dl> </div> </div><p> <a class="anchor" name="78cfec22533db4a28356dedf7a82163e"></a><!-- doxytag: member="Cairo::Win32Surface::create_with_dib" ref="78cfec22533db4a28356dedf7a82163e" args="(Format format, int width, int height)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a><<a class="el" href="classCairo_1_1Win32Surface.html">Win32Surface</a>> Cairo::Win32Surface::create_with_dib </td> <td>(</td> <td class="paramtype"><a class="el" href="namespaceCairo.html#d3f86970e1bd354b263303c9b8759166">Format</a> </td> <td class="paramname"> <em>format</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>height</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Creates a device-independent-bitmap surface not associated with any particular existing surface or device context. <p> The created bitmap will be unititialized.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>format</em> </td><td>format of pixels in the surface to create. </td></tr> <tr><td valign="top"></td><td valign="top"><em>width</em> </td><td>width of the surface, in pixels. </td></tr> <tr><td valign="top"></td><td valign="top"><em>height</em> </td><td>height of the surface, in pixels. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the newly created surface.</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd>1.8 </dd></dl> </div> </div><p> <a class="anchor" name="cdcc018282d8cfed8bc992233a378aa4"></a><!-- doxytag: member="Cairo::Win32Surface::get_dc" ref="cdcc018282d8cfed8bc992233a378aa4" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">HDC Cairo::Win32Surface::get_dc </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> Returns the HDC associated with this surface, or NULL if none. <p> Also returns NULL if the surface is not a win32 surface.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>HDC or NULL if no HDC available. </dd></dl> </div> </div><p> <a class="anchor" name="e34550ff9da8de1739327291c73a9f73"></a><!-- doxytag: member="Cairo::Win32Surface::get_image" ref="e34550ff9da8de1739327291c73a9f73" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a><<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>> Cairo::Win32Surface::get_image </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Returns a <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by...">ImageSurface</a> that refers to the same bits as the DIB of the Win32 surface. <p> If the passed-in win32 surface is not a DIB surface, the returned surface will be NULL<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>a <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by...">ImageSurface</a> (owned by the <a class="el" href="classCairo_1_1Win32Surface.html" title="A Win32Surface provides a way to render within Microsoft Windows.">Win32Surface</a>), or an empty <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr<> is a reference-counting shared smartpointer.">RefPtr</a> if the win32 surface is not a DIB.</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd>1.8 </dd></dl> </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li>cairomm/win32_surface.h</ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Thu Aug 13 11:40:14 2009 for cairomm by  <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>