DisplayImageDC

#include "BIDISP.H"

 

UINT CALLBACK DisplayImageDC( HDC                  hdc,
LPDISPLAYSTRUCT   cb)

Description

This function displays the image passed as a device dependent bitmap to the given device context.

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

If hPal is NULL it will not be used.

If lpptDPI is NULL or the x and y field is zero, then resolution will default to the screen resolution.

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_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 both the vertical and horizontal direction.

DISP_INVERT                     - Displays the image as inverted image.

DISP_SCALED                    - Use DPI information for displaying image.

DISP_CENTER                    -  Forces the image to align centered onto the
window.

DISP_FITTOWIDTH          - Forces the image to fit into the window client area using unique scaling factors in the horizontal direction.

DISP_FITTOHEIGHT        - Forces the image to fit into the window client area using unique scaling factors in the vertical direction.

DISP_FITSCREEN              -  Forces the image to fit into the window client
area using unique scaling factors both in 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.