GetBrushOrgEx Function

Declare Function GetBrushOrgEx Lib "gdi32.dll" (ByVal hdc As Long, lpPoint As POINT_TYPE) As Long

Platforms: Win 32s, Win 95/98, Win NT

GetBrushOrgEx determines the origin point for using a brush on a given device is. All brushes are stored as an 8x8 pixel block, but Windows can offset the "origin" point determining the adjustment of the brush fill is. For example, an origin of (2,3) would shift the fill pattern design 2 pixels right and 3 pixels down. The current brush origin is put into the variable passed as lpPoint. The function returns 1 if successful, or 0 if an error occured.

hdc
A device context to the device to find the brush origin point of.
lpPoint
Receives the (x,y) coordinate pair of the device's brush origin point.

Example:

' Display the brush origin point for window Form1.
Dim brushorg As POINT_TYPE  ' receives brush origin point
Dim retval As Long  ' return value

' Determine the brush origin and display its coordinates:
retval = GetBrushOrgEx(Form1.hDC, brushorg)
Debug.Print "All brush designs are offset"; brushorg.x; "pixels right ";
Debug.Print "and"; brushorg.y; "pixels downward."

See Also: SetBrushOrgEx
Category: Brushes

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getbrushorgex.html