Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>setbrushorg()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SetBrushOrg()
Set the origin that will be used for a brush in a device context
------------------------------------------------------------------------------

Syntax
SetBrushOrg( <hDC>, <nX>, <nY> )   -->   nOldPos

Arguments
<hDC> specifies the device context for a window (or printer).

<nX>, <nY> specify the position of the new origin.  Both
values must be in the range 0 to 7.

Returns
The old origin position is returned as a number.  (This is not
much use.)  The x co-ordinate can be extracted using
C4W_LoWord(), and the y value using C4W_HiWord().

Description
This function makes GDI (graphics device interface) change the
position of the origin that will be used the next time a brush
is selected into the device context.

Do not use this function with any of the stock objects (those
defined as *_BRUSH in WINDOWS.CH).

Example
hRedBrush = CreateHatchBrush( HS_FDIAGONAL, RGB( 255, 0, 0 ) )
     .
     .
     .
UnrealizeObject( hRedBrush )
SetBrushOrg( hDC, 5, 5 )
hOldBrush = SelectObject( hDC, hRedBrush )
     .
     .
     .
// re-select the old brush, and delete the temporary one:
DeleteObject( SelectObject( hOldBrush ) )


See Also: CreateHatchBrush() CreateSolidBrush() UnrealizeObject()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson