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>showdib()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ShowDIB()
Output a device-independent bitmap
------------------------------------------------------------------------------

Syntax
ShowDIB( <hDC>, <cDIB>, [ <nX> ] , [ <nY> ] )   -->   NIL

Arguments
<hDC> is a handle to a device context.

<cDIB> is a device-independent bitmap.

<nX>, <nY> are optional parameters used to specify the
position of the top left-hand corner of the bitmap in pixels.

Returns
NIL.

Description
This function can be used to draw a device-independent bitmap.

If you have a PCX file, you can use the Paintbrush program to
read it, and then use File...Save As to save it as a bitmap in
the correct format.

Example
// since Top and Left are always 0, they are unused
#define W_LEFT      1
#define W_TOP       2
#define W_RIGHT     3
#define W_BOTTOM    4
hDC := GetDC( hWnd )
cDIB := ReadDIB( "clip4win.bmp" )
aDIBRect := GetDIBRect( cDIB )
aClientRect := GetClientRect( hWnd )
// this will centre the bitmap in the window
ShowDIB( hDC, cDIB, (aClientRect[W_RIGHT] - aDIBRect[W_RIGHT]) / 2, ;
                    (aClientRect[W_BOTTOM] - aDIBRect[W_BOTTOM]) / 2 )
ReleaseDC( hWnd, hDC )


See Also: GetDIBRect() ReadDIB()

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