CDC::SetWindowOrg

Sets the window origin of the device context.

CPoint SetWindowOrg( 
   int x, 
   int y  
); 
CPoint SetWindowOrg( 
   POINT point  
);

Parameters

  • x
    Specifies the logical x-coordinate of the new origin of the window.

  • y
    Specifies the logical y-coordinate of the new origin of the window.

  • point
    Specifies the logical coordinates of the new origin of the window. You can pass either a POINT structure or a CPoint object for this parameter.

Return Value

The previous origin of the window as a CPoint object.

Remarks

The window, along with the device-context viewport, defines how GDI maps points in the logical coordinate system to points in the device coordinate system.

The window origin marks the point in the logical coordinate system from which GDI maps the viewport origin, a point in the device coordinate system specified by the SetWindowOrg function. GDI maps all other points by following the same process required to map the window origin to the viewport origin. For example, all points in a circle around the point at the window origin will be in a circle around the point at the viewport origin. Similarly, all points in a line that passes through the window origin will be in a line that passes through the viewport origin.

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

CPoint Class

POINT Structure

CDC::GetWindowOrg