[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
PalBmpDraw( hDC, nRow, nCol, hBmpPal, nWidth, nHeight, nRaster )-> <nil>
------------------------------------------------------------------------------
PARAMETER:
<hDC> Handle that identifies the target device context
<nRow> Row where the bitmap will be painted ( in pixels, unless
an alternative measure is selected with SetMapMode()
<nCol> Col where the bitmap will be painted
<hBmpPal> Is the handle that identifies the bitmap to be drawn, and
the associated palette :
+-----------------------------------+
| hPalette := nHiWord( hBmpPal ) |
| hBitMap := nLoWord( hBmpPal ) |
+-----------------------------------+
This handle is returnd by PalBmpRead or PalBmpLoad,
and destroyed with PalBmpFree( hBmpPal )
<nWidth> Optional horizontal size of the bitmap. If this parameter
is omitted, the actual size of the bitmap is taken.
<nHeight> Optional vertical size of the bitmap.
<nRaster> Is a numeric value that determines the raster operation to
be performed by the GDI. See DrawBitmap for a detailed
list of available codes.
DESCRIPTION:
PalBmpDraw() can be used to draw the previously loaded BMP Bitmap on
to a window. If the actual bitmap size is larger than the <nWidth> or
<nHeight> value, the bitmap will be clipped to the given size.
If it is smaller, then the bitmap will be stretched to the new size.
EXAMPLE:
+--------------------------------------------------------------+
| /* Load a bitmap from file */ |
| hBmp := ReadBitmap( 0, "bitmaps\logo.bmp" ) |
| |
| /* Define a dialog */ |
| DEFINE DIALOG oDlg FROM 5,5 TO 20, 60 TITLE "BMP" |
| @ 8,8 BUTTON "&OK" SIZE 40, 12 ACTION oDlg:end() |
| |
| /* Activate the dialog, draw the bitmap */ |
| ACTIVATE DIALOG oDlg ; |
| ON PAINT PalBmpDraw( hDC, 10, 10, hBmp ) |
| |
| PalBmpFree( hBmp ) |
+--------------------------------------------------------------+
To draw a bitmap that covers the whole window, set nRow, nCol to zero:
+--------------------------------------------------------------+
| /* Draw WallPaper */ |
| DEFINE BITMAP oBmp FILENAME "Back.bmp" |
| oWnd:bPainted := {|hDC|PalBmpDraw( hDC,0,0,oBmp:hBmpPal)} |
| |
| ACTIVATE WINDOW oWnd .. |
+--------------------------------------------------------------+
SOURCE:
SOURCE\WINAPI\FWBMP.C
See Also:
LoadBitMap
ReadBitMap
TBitmap
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson