#include "BIDISP.H"
VOID CALLBACK DisplayDIBImage( HWND hWnd,
HANDLE hDIB,
LPRECT lprScroll,
LPRECT lprScale,
WORD wDisplayFormat)
Description
This function displays the device independent bitmap. The DisplayDIBImage() function should be called only in response to the WM_PAINT message.
Parameters
|
HWND |
hWnd |
Window handle to display image. |
|
HANDLE |
hDIB |
Device independent bitmap handle. |
|
LPRECT |
lprScroll |
The scrolling area. |
|
LPRECT |
lprScale |
The X and Y scaling factor. |
|
WORD |
wDisplayFormat |
Display mode. |
Return values
None.
Programming notes
if lpptDPI is NULL or the x and y field is zero then DPI resolution will default to the screen resolution.
The scaling factor is stored in the a RECT data structure where one can define the ratio for scaling for the X or Y coordinate by two integers as 3:4 or 13:19 in the lprScale->left and lprScale->top field for X coordinate and lprScale->right and lprScale->bottom for the Y coordinate. For example:
Scaling in X axis = left:top 1:3 increase the image width by three times.
Scaling in Y axis = right:bottom 1:3 increase the image height by three times.
WORD wDisplayFormat can be set to DISP_NORMAL, DISP_ZOOM, or DISP_PREVIEW. The DISP_NORMAL will display the image proportionally. The DISP_ZOOM user has to set the lprScale factor to reflect the zoom in or out factor. The DISP_PREVIEW forces the image to fit into the client area.
Requirements
Header : Declared in BIDisp.h; include BIDisp.h.
Library : Use BIDisp.lib.
DLLs : BIDisp.dll, BiDIB.dll.
Code Example
#include "BIDISP.H"
.
.
.
case WM_PAINT:
// Image is in the DIB
DisplayDIBImage(hWnd, hDIB, &rScroll, &rScale, nDispFormat);
break;
.
.
.