GetBrushOrg

2.x

  DWORD GetBrushOrg(hdc)    
  HDC hdc; /* handle of device context */

The GetBrushOrg function retrieves the origin, in device coordinates, of the brush currently selected for the given device context.

Parameters

hdc

Identifies the device context.

Return Value

The low-order word of the return value contains the current x-coordinate of the brush, in device coordinates, if the function is successful; the high-order word contains the y-coordinate.

Comments

The initial brush origin is at the coordinates (0,0) in the client area. The return value specifies these coordinates in device units relative to the origin of the desktop window.

Example

The following example uses the LOWORD and HIWORD macros to extract the x- and y-coordinate of the current brush from the return value of the GetBrushOrg function:

DWORD dwBrOrg;
WORD wXBrOrg, wYBrOrg;

dwBrOrg = GetBrushOrg(hdc);
wXBrOrg = LOWORD(dwBrOrg);
wYBrOrg = HIWORD(dwBrOrg);

See Also

SelectObject, SetBrushOrg