PAINTCALLBACK_STRETCHDIBITS Function - Raster Imaging C API Help

PAINTCALLBACK_STRETCHDIBITS Function

#include "l_bitmap.h"

L_BOOL pEXT_CALLBACK YourFunction(pDisplay, nXDest, nYDest, nDestWidth, nDestHeight, nXSrc, nYSrc, nSrcWidth, nSrcHeight, lpvBits, lpbmi, fuColorUse, ulROP3Code, pUserData)

L_VOID *pDisplay;

device context handle

L_INT nXDest;

x-coord of destination upper-left corner

L_INT nYDest;

y-coord of destination upper-left corner

L_INT nDestWidth;

width of destination rectangle

L_INT nDestHeight;

height of destination rectangle

L_INT nXSrc;

x-coord of source upper-left corner

L_INT nYSrc;

y-coord of source upper-left corner

L_INT nSrcWidth;

width of source rectangle

L_INT nSrcHeight;

height of source rectangle

L_VOID lpvBits;

pointer to bitmap bits

BITMAPINFO lpbmi;

pointer to information on bitmap data

L_UINT fuColorUse;

palette usage options

L_UINT32 ulROP3Code;

raster operation code

L_VOID pUserData;

pointer to additional data

This is the callback that replaces the StretchDIBits GDI function.

Parameter

Description

pDisplay

Handle of the device context passed to the paint function.

nXDest

Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.

nYDest

Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.

nDestWidth

Specifies the width, in logical units, of the destination rectangle.

nDestHeight

Specifies the height, in logical units, of the destination rectangle.

nXSrc

Specifies the x-coordinate, in pixels, of the source rectangle in the DIB.

nYSrc

Specifies the y-coordinate, in pixels, of the source rectangle in the DIB.

nSrcWidth

Specifies the width, in pixels, of the source rectangle in the DIB.

nSrcHeight

Specifies the height, in pixels, of the source rectangle in the DIB.

lpvBits

Pointer to the DIB bits, which are stored as an array of bytes.

lpbmi

Pointer to a BITMAPINFO structure that contains information about the DIB.

fuColorUse

Specifies whether the bmiColors member of the BITMAPINFO structure was provided and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes.

ulROP3Code

Specifies how the source pixels, the destination device context's current brush, and the destination pixels are to be combined to form the new image.

pUserData

Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the PAINTCALLBACKDATA structure.)

Returns

The return values are the same as the return values for the corresponding GDI function.

Comments

The internal display engine calls your callback function if you override the corresponding GDI function in the PAINTCALLBACKDATA structure.

pDisplay is the pDisplay member from the PAINTCALLBACKDATA structure that you passed to the paint function. The default callbacks expect it to be a HDC handle. But, if you override all the paint callbacks, it can be a pointer of any type you want.

Please see the Microsoft documentation for the values you are expected to return and for the meaning of the parameters before pUserData.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

Example

For an example, refer to L_PaintDCCallback.

Help Version 20.0.2018.7.30
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help