Export (0) Print
Expand All
MFC
Expand Minimize

CDC::SetViewportExt 

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


virtual CSize SetViewportExt(
   int cx,
   int cy 
);
CSize SetViewportExt(
   SIZE size 
);

Parameters

cx

Specifies the x-extent of the viewport (in device units).

cy

Specifies the y-extent of the viewport (in device units).

size

Specifies the x- and y-extents of the viewport (in device units).

The previous extents of the viewport as a CSize object. When an error occurs, the x- and y-coordinates of the returned CSize object are both set to 0.

The viewport, along with the device-context window, defines how GDI maps points in the logical coordinate system to points in the coordinate system of the actual device. In other words, they define how GDI converts logical coordinates into device coordinates.

When the following mapping modes are set, calls to SetWindowExt and SetViewportExt are ignored:

MM_HIENGLISH MM_LOMETRIC

MM_HIMETRIC

MM_TEXT

MM_LOENGLISH

MM_TWIPS

When MM_ISOTROPIC mode is set, an application must call the SetWindowExt member function before it calls SetViewportExt.

See the example for CView::OnPrepareDC.

Community Additions

ADD
Show:
© 2014 Microsoft