BOOL SetViewportExtEx(hdc, nX, nY, lpSize) | |||||
HDC hdc; | /* handle of device context | */ | |||
int nX; | /* x-extent of viewport, */ | ||||
int nY; | /* y-extent of viewport, */ | ||||
SIZE FAR* lpSize; | /* address of struct. with prev. extents | */ |
The SetViewportExtEx function sets the x- and y-extents of the viewport of the specified device context. The viewport, along with the window, defines how points are mapped from logical coordinates to device coordinates.
hdc
Identifies the device context.
nX
Specifies the x-extent of the viewport, in device units.
nY
Specifies the y-extent of the viewport, in device units.
lpSize
Points to a SIZE structure. The previous extents of the viewport, in device units, are placed in this structure. If lpSize is NULL, nothing is returned. The SIZE structure has the following form:
typedef struct tagSIZE {
int cx;
int cy;
} SIZE;
For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.
The return value is nonzero if the function is successful. Otherwise, it is zero.
When the following mapping modes are set, calls to the SetWindowExtEx and SetViewportExtEx functions are ignored:
MM_HIENGLISH
MM_HIMETRIC
MM_LOENGLISH
MM_LOMETRIC
MM_TEXT
MM_TWIPS
When MM_ISOTROPIC mode is set, an application must call the SetWindowExtEx function before it calls SetViewportExtEx.