Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Mapping Operations
[GDI functions]

Defines

Functions


Detailed Description

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.

So far, MiniGUI support only two mapping mode:

The following formula shows the math involved in converting a point from page space to device space:

      Dx = ((Lx - WOx) * VEx / WEx) + VOx

The following variables are involved:

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.


Define Documentation

#define GetMapMode hdc   )     (int)GetDCAttr (hdc, DC_ATTR_MAP_MODE)
 

Retrives the current mapping mode of a DC.

This function retrives the current mapping mode of the DC hdc.

So far, MiniGUI support two mapping modes: MM_TEXT and MM_ANISOTROPIC.

Parameters:
hdc The device context.
Returns:
The current mapping mode, can be either MM_TEXT or MM_ANISOTROPIC.
Note:
Defined as a macro calling GetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetMapMode is defined as a function, and have the same semantics as this macro.
See also:
SetWindowExt, SetViewportExt, SetMapMode

Definition at line 3839 of file gdi.h.

#define GetViewportExt hdc,
pPt   )     GetDCLCS(hdc, DC_LCS_VEXT, pPt)
 

Retrieves the x-extents and y-extents of the current viewport for a device context.

This function retrives the x-extents and y-extens of the current viewport of the specified device context hdc.

Parameters:
hdc The device context.
pPt The viewport extents will be returned through this buffer.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetViewportExt is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, SetViewportExt

Definition at line 3970 of file gdi.h.

#define GetViewportOrg hdc,
pPt   )     GetDCLCS(hdc, DC_LCS_VORG, pPt)
 

Retrieves the x-coordinates and y-coordinates of the viewport origin for a device context.

This function retrives the x-coordinates and y-coordinates of the viewport origin of the specified device context hdc.

Parameters:
hdc The device context.
pPt The viewport origin will be returned through this buffer.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetViewportOrg is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, SetViewportOrg

Definition at line 3951 of file gdi.h.

#define GetWindowExt hdc,
pPt   )     GetDCLCS(hdc, DC_LCS_WEXT, pPt)
 

Retrieves the x-extents and y-extents of the current window for a device context.

This function retrives the x-extents and y-extens of the current window of the specified device context hdc.

Parameters:
hdc The device context.
pPt The window extents will be returned through this buffer.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetWindowExt is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, SetWindowExt

Definition at line 4008 of file gdi.h.

#define GetWindowOrg hdc,
pPt   )     GetDCLCS(hdc, DC_LCS_WORG, pPt)
 

Retrieves the x-coordinates and y-coordinates of the window for a device context.

This function retrives the x-coordinates and y-coordinates of the window origin of the specified device context hdc.

Parameters:
hdc The device context.
pPt The window origin will be returned through this buffer.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetWindowOrg is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, SetWindowOrg

Definition at line 3989 of file gdi.h.

#define SetMapMode hdc,
mapmode   )     (int)SetDCAttr (hdc, DC_ATTR_MAP_MODE, (DWORD)mapmode)
 

Sets the mapping mode of a display context.

This function sets the mapping mode of the specified display context hdc.

So far, MiniGUI support two mapping modes: MM_TEXT and MM_ANISOTROPIC.

Parameters:
hdc The device context.
mapmode The new mapping mode, should be either MM_TEXT or MM_ANISOTROPIC.
Returns:
The old mapping mode, either MM_TEXT or MM_ANISOTROPIC.
Note:
Defined as a macro calling SetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetMapMode is defined as a function, and have the same semantics as this macro.
See also:
SetWindowExt, SetViewportExt, SetMapMode

Definition at line 3860 of file gdi.h.

#define SetViewportExt hdc,
pPt   )     SetDCLCS(hdc, DC_LCS_VEXT, pPt)
 

Sets the x-extents and y-extents of the current viewport for a device context.

This function sets the x-extents and y-extens of the current viewport of the specified device context hdc.

Parameters:
hdc The device context.
pPt The viewport extents will be set.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetViewportExt is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, GetViewportExt

Definition at line 4046 of file gdi.h.

#define SetViewportOrg hdc,
pPt   )     SetDCLCS(hdc, DC_LCS_VORG, pPt)
 

Sets the x-coordinates and y-coordinates of the viewport origin for a device context.

This function sets the x-coordinates and y-coordinates of the viewport origin of the specified device context hdc.

Parameters:
hdc The device context.
pPt The viewport origin will be set.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetViewportOrg is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, GetViewportOrg

Definition at line 4027 of file gdi.h.

#define SetWindowExt hdc,
pPt   )     SetDCLCS(hdc, DC_LCS_WEXT, pPt)
 

Sets the x-extents and y-extents of the current window for a device context.

This function sets the x-extents and y-extens of the current window of the specified device context hdc.

Parameters:
hdc The device context.
pPt The window extents will be set.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetWindowExt is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, GetWindowExt

Definition at line 4084 of file gdi.h.

#define SetWindowOrg hdc,
pPt   )     SetDCLCS(hdc, DC_LCS_WORG, pPt)
 

Sets the x-coordinates and y-coordinates of the window for a device context.

This function sets the x-coordinates and y-coordinates of the window origin of the specified device context hdc.

Parameters:
hdc The device context.
pPt The window origin will be set.
Note:
Defined as a macro calling GetDCLCS for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetWindowOrg is defined as a function, and have the same semantics as this macro.
See also:
GetMapMode, GetWindowOrg

Definition at line 4065 of file gdi.h.


Function Documentation

void GUIAPI DPtoLP HDC  hdc,
POINT pPt
 

Converts device coordinates into logical coordinates.

This function converts device coordinates into logical coordinates in the device context hdc.

The conversion depends on the mapping mode of the display context, the settings of the origins and extents for the window and viewport. The x-coordinate and y-coordinate contained in struct pPt will be transformed.

Parameters:
hdc The device context.
pPt The coordinates to be converted, and the transformed coordinates will be contained in this buffer after the function returns.
See also:
LPtoDP

void GUIAPI GetDCLCS HDC  hdc,
int  which,
POINT pt
 

Retrives mapping parameters of a device context.

This function retrives mapping paramters of the specified device context hdc when the mapping mode is not MM_TEXT.

Parameters:
hdc The device context.
which Which parameter you want to retrive, can be one of the following values:
  • DC_LCS_VORG
    Retrives the x-coordinates and y-coordinates of the viewport origin.
  • DC_LCS_VEXT
    Retrives the x-extents and y-extents of the current viewport.
  • DC_LCS_WORG
    Retrives the x-coordinates and y-coordinates of the window origin.
  • DC_LCS_WEXT
    Retrives the x-extents and y-extents of the window.

Parameters:
pt The coordinates or extents will be returned through this buffer.
Note:
Only defined for _USE_NEWGAL
See also:
GetMapMode, SetMapMode, SetDCLCS

void GUIAPI LPtoDP HDC  hdc,
POINT pPt
 

Converts logical coordinates into device coordinates.

This function converts logical coordinates into device coordinates in the device context hdc.

The conversion depends on the mapping mode of the display context, the settings of the origins and extents for the window and viewport. The x-coordinate and y-coordinate contained in struct pPt will be transformed.

Parameters:
hdc The device context.
pPt The coordinates to be converted, and the transformed coordinates will be contained in this buffer after the function returns.
See also:
DPtoLP

void GUIAPI SetDCLCS HDC  hdc,
int  which,
const POINT pt
 

Sets mapping parameters of a device context.

This function sets mapping paramters of the specified device context hdc when the mapping mode is not MM_TEXT.

Parameters:
hdc The device context.
which Which parameter you want to retrive, can be one of the following values:
  • DC_LCS_VORG
    Sets the x-coordinates and y-coordinates of the viewport origin.
  • DC_LCS_VEXT
    Sets the x-extents and y-extents of the current viewport.
  • DC_LCS_WORG
    Sets the x-coordinates and y-coordinates of the window origin.
  • DC_LCS_WEXT
    Sets the x-extents and y-extents of the window.

Parameters:
pt The coordinates or extents will be set.
Note:
Only defined for _USE_NEWGAL
See also:
GetMapMode, SetMapMode, GetDCLCS


Generated on Mon Jun 26 13:54:30 2006 for MiniGUI V1.6.9 API Reference by  doxygen 1.4.2