GetBrushOrgEx

  BOOL GetBrushOrgEx(hdc, lppt)    
  HDC hdc; /* handle of device context */
  LPPOINT lppt; /* address of point structure */

The GetBrushOrgEx function retrieves the current brush origin for the given device context.

Parameters

hdc

Identifies the device context.

lppt

Points to a POINT structure that receives the brush origin in device coordinates. The POINT structure has the following format:

typedef struct tagPOINT { /* pt */

LONG x;

LONG y;

} POINT;

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

A brush is an 8-pixel by 8-pixel bitmap that Windows uses to paint the interior of filled objects.

The brush origin is a coordinate that specifies the location of one of the pixels in the bitmap. These coordinates can be any value between 0 and 7. (For horizontal coordinates, the value 0 corresponds to the leftmost column of pixels and the value 7 corresponds to the rightmost column. For vertical coordinates, the value 0 corresponds to the topmost row of pixels and the value 7 corresponds to the bottommost row.) When Windows positions the brush at the start of any painting operation, it maps the pixel at the brush's origin to the upper-left corner of the application's client area.

If an application uses a brush to fill the backgrounds of both a parent and a child window and requires that the backgrounds match, it will probably be necessary to set the brush origin after painting the parent window and prior to painting the the child window.

The default brush origin is at the coordinate (0,0).

See Also

POINT, SetBrushOrg