📄 group__map__fns.htm
字号:
<!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>MiniGUI V1.6.10 API Reference: Mapping Operations</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.htm">Main Page</a> | <a class="qindex" href="modules.htm">Modules</a> | <a class="qindex" href="classes.htm">Alphabetical List</a> | <a class="qindex" href="annotated.htm">Data Structures</a> | <a class="qindex" href="dirs.htm">Directories</a> | <a class="qindex" href="files.htm">File List</a> | <a class="qindex" href="functions.htm">Data Fields</a> | <a class="qindex" href="globals.htm">Globals</a> | <a class="qindex" href="pages.htm">Related Pages</a></div><h1>Mapping Operations<br><small>[<a class="el" href="group__gdi__fns.htm">GDI functions</a>]</small></h1><h2>Defines</h2><ul><li>#define <a class="el" href="group__map__fns.htm#ga6">GetMapMode</a>(hdc) GetDCAttr (hdc, DC_ATTR_MAP_MODE)<dl class="el"><dd class="mdescRight">Retrieves the current mapping mode of a DC. <a href="#ga6"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga7">SetMapMode</a>(hdc, mapmode) SetDCAttr (hdc, DC_ATTR_MAP_MODE, (<a class="el" href="group__win32__types.htm#ga4">DWORD</a>)mapmode)<dl class="el"><dd class="mdescRight">Sets the mapping mode of a display context. <a href="#ga7"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga13">GetViewportOrg</a>(hdc, pPt) GetDCLCS(hdc, DC_LCS_VORG, pPt)<dl class="el"><dd class="mdescRight">Retrieves the x-coordinates and y-coordinates of the viewport origin for a device context. <a href="#ga13"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga14">GetViewportExt</a>(hdc, pPt) GetDCLCS(hdc, DC_LCS_VEXT, pPt)<dl class="el"><dd class="mdescRight">Retrieves the x-extents and y-extents of the current viewport for a device context. <a href="#ga14"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga15">GetWindowOrg</a>(hdc, pPt) GetDCLCS(hdc, DC_LCS_WORG, pPt)<dl class="el"><dd class="mdescRight">Retrieves the x-coordinates and y-coordinates of the window for a device context. <a href="#ga15"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga16">GetWindowExt</a>(hdc, pPt) GetDCLCS(hdc, DC_LCS_WEXT, pPt)<dl class="el"><dd class="mdescRight">Retrieves the x-extents and y-extents of the current window for a device context. <a href="#ga16"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga17">SetViewportOrg</a>(hdc, pPt) SetDCLCS(hdc, DC_LCS_VORG, pPt)<dl class="el"><dd class="mdescRight">Sets the x-coordinates and y-coordinates of the viewport origin for a device context. <a href="#ga17"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga18">SetViewportExt</a>(hdc, pPt) SetDCLCS(hdc, DC_LCS_VEXT, pPt)<dl class="el"><dd class="mdescRight">Sets the x-extents and y-extents of the current viewport for a device context. <a href="#ga18"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga19">SetWindowOrg</a>(hdc, pPt) SetDCLCS(hdc, DC_LCS_WORG, pPt)<dl class="el"><dd class="mdescRight">Sets the x-coordinates and y-coordinates of the window for a device context. <a href="#ga19"></a><br></dl><li>#define <a class="el" href="group__map__fns.htm#ga20">SetWindowExt</a>(hdc, pPt) SetDCLCS(hdc, DC_LCS_WEXT, pPt)<dl class="el"><dd class="mdescRight">Sets the x-extents and y-extents of the current window for a device context. <a href="#ga20"></a><br></dl></ul><h2>Functions</h2><ul><li>MG_EXPORT void GUIAPI <a class="el" href="group__map__fns.htm#ga0">GetDCLCS</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, int which, <a class="el" href="struct__POINT.htm">POINT</a> *pt)<dl class="el"><dd class="mdescRight">Retrieves mapping parameters of a device context. <a href="#ga0"></a><br></dl><li>MG_EXPORT void GUIAPI <a class="el" href="group__map__fns.htm#ga1">SetDCLCS</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, int which, const <a class="el" href="struct__POINT.htm">POINT</a> *pt)<dl class="el"><dd class="mdescRight">Sets mapping parameters of a device context. <a href="#ga1"></a><br></dl><li>MG_EXPORT void GUIAPI <a class="el" href="group__map__fns.htm#ga2">DPtoLP</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, <a class="el" href="struct__POINT.htm">POINT</a> *pPt)<dl class="el"><dd class="mdescRight">Converts device coordinates into logical coordinates. <a href="#ga2"></a><br></dl><li>MG_EXPORT void GUIAPI <a class="el" href="group__map__fns.htm#ga3">LPtoDP</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, <a class="el" href="struct__POINT.htm">POINT</a> *pPt)<dl class="el"><dd class="mdescRight">Converts logical coordinates into device coordinates. <a href="#ga3"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>The mapping mode defines the unit of measure used to transform page-space units into device-space units, and also defines the orientation of the device's x and y axes.<p>So far, MiniGUI support only two mapping mode:<p><ul><li>MM_TEXT<br> Each logical unit is mapped to on device pixel. Positive x is to the right; positive y is down.</li><li>MM_ANISOTROPIC<br> Logical units are mapped to arbitrary units with arbitrarily scaled axes; Use <em>SetWindowExt</em> and <em>SetViewportExt</em> functions to specify the units, orientation, and scaling required.</li></ul><p>The following formula shows the math involved in converting a point from page space to device space:<p><div class="fragment"><pre class="fragment"> Dx = ((Lx - WOx) * VEx / WEx) + VOx</pre></div><p>The following variables are involved:<p><ul><li>Dx x value in device units</li><li>Lx x value in logical units (also known as page space units)</li><li>WO window x origin</li><li>VO viewport x origin</li><li>WE window x-extent</li><li>VE viewport x-extent</li></ul><p>The same equation with y replacing x transforms the y component of a point. The formula first offsets the point from its coordinate origin. This value, no longer biased by the origin, is then scaled into the destination coordinate system by the ratio of the extents. Finally, the scaled value is offset by the destination origin to its final mapping. <hr><h2>Define Documentation</h2><a class="anchor" name="ga6" doxytag="gdi.h::GetMapMode"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define GetMapMode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">hdc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> GetDCAttr (hdc, DC_ATTR_MAP_MODE)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieves the current mapping mode of a DC. <p>This function retrieves the current mapping mode of the DC <em>hdc</em>.<p>So far, MiniGUI support two mapping modes: MM_TEXT and MM_ANISOTROPIC.<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 device context.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The current mapping mode, can be either <em>MM_TEXT</em> or <em>MM_ANISOTROPIC</em>.</dd></dl><dl compact><dt><b>Note:</b></dt><dd>Defined as a macro calling <em>GetDCAttr</em> for _USE_NEWGAL. If _USE_NEWGAL is not defined, <em>GetMapMode</em> is defined as a function, and have the same semantics as this macro.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__map__fns.htm#ga20">SetWindowExt</a>, <a class="el" href="group__map__fns.htm#ga18">SetViewportExt</a>, <a class="el" href="group__map__fns.htm#ga7">SetMapMode</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l03951">3951</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga14" doxytag="gdi.h::GetViewportExt"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define GetViewportExt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">hdc, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>pPt </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> GetDCLCS(hdc, DC_LCS_VEXT, pPt)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieves the x-extents and y-extents of the current viewport for a device context. <p>This function retrieves the x-extents and y-extens of the current viewport of the specified device context <em>hdc</em>.<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 device context. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pPt</em> </td><td>The viewport extents will be returned through this buffer.</td></tr> </table></dl><dl compact><dt><b>Note:</b></dt><dd>Defined as a macro calling <em>GetDCLCS</em> for _USE_NEWGAL. If _USE_NEWGAL is not defined, <em>GetViewportExt</em> is defined as a function, and have the same semantics as this macro.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__map__fns.htm#ga6">GetMapMode</a>, <a class="el" href="group__map__fns.htm#ga18">SetViewportExt</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l04082">4082</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga13" doxytag="gdi.h::GetViewportOrg"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define GetViewportOrg </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">hdc, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>pPt </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> GetDCLCS(hdc, DC_LCS_VORG, pPt)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieves the x-coordinates and y-coordinates of the viewport origin for a device context. <p>This function retrieves the x-coordinates and y-coordinates of the viewport origin of the specified device context <em>hdc</em>.<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 device context. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pPt</em> </td><td>The viewport origin will be returned through this buffer.</td></tr> </table></dl><dl compact><dt><b>Note:</b></dt><dd>Defined as a macro calling <em>GetDCLCS</em> for _USE_NEWGAL. If _USE_NEWGAL is not defined, <em>GetViewportOrg</em> is defined as a function, and have the same semantics as this macro.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__map__fns.htm#ga6">GetMapMode</a>, <a class="el" href="group__map__fns.htm#ga17">SetViewportOrg</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l04063">4063</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga16" doxytag="gdi.h::GetWindowExt"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define GetWindowExt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">hdc, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>pPt </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> GetDCLCS(hdc, DC_LCS_WEXT, pPt)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieves the x-extents and y-extents of the current window for a device context. <p>This function retrieves the x-extents and y-extens of the current window of the specified device context <em>hdc</em>.<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 device context. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pPt</em> </td><td>The window extents will be returned through this buffer.</td></tr> </table></dl><dl compact><dt><b>Note:</b></dt><dd>Defined as a macro calling <em>GetDCLCS</em> for _USE_NEWGAL. If _USE_NEWGAL is not defined, <em>GetWindowExt</em> is defined as a function, and have the same semantics as this macro.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__map__fns.htm#ga6">GetMapMode</a>, <a class="el" href="group__map__fns.htm#ga20">SetWindowExt</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l04120">4120</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga15" doxytag="gdi.h::GetWindowOrg"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define GetWindowOrg </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">hdc, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>pPt </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> GetDCLCS(hdc, DC_LCS_WORG, pPt)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -