SetViewportExt

SetViewportExt,函式功能為該函式以設備單位或像素點設定“視區範圍”。

基本介紹

  • 外文名:SetViewportExt
  • 設備單位:"cx"和"cy"或"size"
  • 表示:視區的大小
  • 結合:視窗的映射模式使用
函式原型,參數,

函式原型

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

參數

"cx"和"cy"或"size"是設備單位,用來表示視區的大小,結合視窗的映射模式使用。
CDC::SetViewportExt
virtual CSize SetViewportExt( int cx, int cy );
virtual CSize SetViewportExt( SIZE size );
Return Value
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.
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).
Remarks
Sets the x- and y-extents of the viewport of the device context. 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.

相關詞條

熱門詞條

聯絡我們