DisplayDIBImageDC

#include "BIDISP.H"

 

WORD CALLBACK DisplayDIBImageDC(                HDC           hdc
                                                                        LPDISPLAYSTRUCT cb)

Description

This function displays the image passed as a device independent bitmap onto the given device context. The DPI resolution is part of the BITMAPINFOHEADER data structure.

Parameters

HDC

hdc

Identifies the handle of a device context.

LPDISPLAYSTRUCT

cb

Display information structure.

Return values

0 on failures, display format on success.

Programming notes

The scaling factor is stored in the 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 code example:

Scaling in X axis = left;top 1:3 increases the image width by three times
Scaling in Y axis = right;bottom 1:3 increases the image height by three times

UINT wDisplayFormat member of the cb structure can be set to:

   DISP_NEWDIB                     - Regenerate the a new BITMAP internally.

   DISP_NORMAL                   - Display image pixel by pixel.

   DISP_PREVIEW                  - Forces the image to fit into the window client area using DPI information and unique scaling factors in both the vertical and horizontal direction.

   DISP_INVERT                      - Displays the image an inverted image.

   DISP_SCALED                     - Use DPI information for displaying image.

   DISP_CENTER                    -  Forces the image to be aligned centered onto the window.

   DISP_FITSCREEN              - Forces the image to fit into the window client area using unique scaling factors in both the vertical and horizontal direction.

   DISP_NOVERTSCROLL   - Prevents the vertical scroll bar to be shown.

   DISP_NOHORZSCROLL   - Prevents the horizontal scroll bar to be shown.

The display formats can be combined by the β€œ|” binary β€œOR” operator. For example, DISP_INVERT | DISP_NORMAL is valid.

In the case of, DISP_NORMAL | DISP_SCALED. The DISP_SCALED takes precedence over DISP_NORMAL.

Requirements

Header :     Declared in BIDisp.h; include BIDisp.h.

Library :    Use BIDisp.lib.

DLLs :       BIDisp.dll, BiDIB.dll.