ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Display Functions > IG_dspl_mapmode_set

This function sets the current map mode and logical coordinate system.


Copy Code
AT_ERRCOUNT  ACCUAPI  IG_dspl_mapmode_set(
        [IN] HIGEAR hIGear,
        [IN] DWORD dwGrpID,
        [IN] DWORD dwMapMode,
        [IN] const LPAT_RECTANGLE lpViewport,
        [IN] const LPAT_RECTANGLE lpWindow


Name Type Description
hIGear HIGEAR ImageGear handle of image.
dwGrpID DWORD Identifier of group in which to set map mode options.
dwMapMode DWORD New value of option MapMode to assign.
LpViewport const LPAT_RECTANGLE New value of Viewport option to assign.
LpWindow const LPAT_RECTANGLE New value of Window option to assign.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.


Copy Code
HIGEAR           hIGear;     /* HIGEAR handle of image  */ 
DWORD           nGrpID;      /* display group identifier  */
DWORD           dwMapMode;       /* map mode   */
AT_RECTANGLE            Viewport;         /* view port values  */
AT_RECTANGLE             Window;          /* window values  */
POINT           p;
SIZE            s;
/* get current mapping parameters */
dwMapMode = GetMapMode( hDC );
GetViewportOrgEx( hDC, &p );
Viewport.x = p.x;
Viewport.y = p.y;
GetViewportExtEx( hDC, &s );
Viewport.width =;
Viewport.height =;
GetWindowOrgEx( hDC, &p );
Window.x = p.x;
Window.y = p.y;
GetWindowExtEx( hDC, &s );
Window.width =;
Window.height =;
IG_dspl_mapmode_set( hIGear, nGrpID, dwMapMode, &Viewport, &Window );


ImageGear will perform all calculations with the assumption that the specified logical system is used for the device coordinates.

Is this page helpful?
Yes No
Thanks for your feedback.