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

Syntax
StretchDIBits( <hDC>, <nXDest>, <nYDest>, <nWDest>, <nHDest>,
               <nXSrc>, <nYSrc>, [ <nWSrc> ] , [ <nHSrc> ] ,
               [ <acDIBits> ] , <acDIB>, [ <nColor> ] , [ <nROP> ] )
          -->   nScanLines

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

<nXDest>, <nYDest> are used to specify the position of the top
left-hand corner of the destination of the bitmap in pixels.

<nWDest>, <nHDest> specify the width and height to fit the
bitmap into.

<nXSrc>, <nYSrc> are used to specify the position of the top
left-hand corner of the source bitmap in pixels.

<nWSrc>, <nHSrc> specify the width and height of the bitmap
into.  They default to the size implied by <acDIB>.

<acDIBits> optionally specifies the bits of the bitmap.  The
default is to use part of <acDIB>.

<acDIB> is a device-independent bitmap.

<nColor> optionally specifies the type of colour-coding to use.

<nROP> optionally specifies the raster operation to use
(default SRCCOPY).

Returns
The number of scan lines copied.

Description
This function can be used to change the scale of a device-independent
bitmap.

Example
#define W_RIGHT     3
#define W_BOTTOM    4
hDC := GetDC( hWnd )
acDIB := ReadDIB( "clip4win.bmp" )
aDIBRect := GetDIBRect( acDIB )
aCRect := GetClientRect( hWnd )
// this will stretch/shrink the bitmap to fit the window
StretchDIBits( hDC, 0, 0, aCRect[W_RIGHT], aCRect[W_BOTTOM], ;
               0, 0, , ,  ;
               , acDIB )
ReleaseDC( hWnd, hDC )

See Also: GetDIBRect() ReadDIB() ShowDIB()

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