Microsoft Windows CE 3.0  

SetBrushOrgEx

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function is called by an application to set the brush origin of the next brush selected into the specified device context.

BOOL
SetBrushOrgEx( HDC
hdc
, int
nXOrg
, int
nYOrg
, LPPOINT
lppt
);

Parameters

hdc
[in] Handle to the device context.
nXOrg
[in] Specifies the x-coordinate, in device units, of the new brush origin. If this value is greater than the brush width, its value is reduced using the modulus operator ( nXOrgmod brush width).
nYOrg
[in] Specifies the y-coordinate, in device units, of the new brush origin. If this value is greater than the brush height, its value is reduced using the modulus operator ( nYOrgmod brush height).
lppt
[out] Long pointer to a POINTstructure that receives the previous brush origin.

This parameter can be NULL if the previous brush origin is not required.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

A brush is a bitmap that the system uses to paint the interiors of filled shapes.

The brush origin is a pair of coordinates specifying the location of one pixel in the bitmap. The default brush origin coordinates are (0,0). For horizontal coordinates, the value 0 corresponds to the leftmost column of pixels; the width corresponds to the rightmost column. For vertical coordinates, the value 0 corresponds to the uppermost row of pixels; the height corresponds to the lowermost row.

The system automatically tracks the origin of all window-managed device contexts and adjusts their brushes as necessary to maintain an alignment of patterns on the surface. The brush origin that is set with this call is relative to the upper-left corner of the client area.

An application should call SetBrushOrgExafter using SetStretchBltModeto set the bitmap stretching mode to HALFTONE. This must be done to avoid brush misalignment.

Automatic tracking of the brush origin is not supported. Applications must call SetBrushOrgExto align the brush before using it and call the SelectObjectfunction to select the modified brush..

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Wingdi.h   Mgdraw.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, SelectObject, POINT