PAINTCALLBACKDATA

typedef struct _PAINTCALLBACKDATA 
{ 
   L_UINT uStructSize; 
   L_UINT32 uFlags; 
   L_VOID *pDisplay; 
   L_VOID *pUserData; 
   PAINTCALLBACK_GETDEVICECAPS pGetDeviceCaps; 
   PAINTCALLBACK_GETMAPMODE pGetMapMode; 
   PAINTCALLBACK_SETSTRETCHBLTMODE pSetStretchBltMode; 
   PAINTCALLBACK_INTERSECTCLIPRECT pIntersectClipRect; 
   PAINTCALLBACK_SAVEDC pSaveDC; 
   PAINTCALLBACK_RESTOREDC pRestoreDC; 
   PAINTCALLBACK_STRETCHDIBITS pStretchDIBits; 
   PAINTCALLBACK_SETVIEWPORTORGEX pSetViewportOrgEx; 
   PAINTCALLBACK_GETVIEWPORTORGEX pGetViewportOrgEx; 
   PAINTCALLBACK_EXTSELECTCLIPRGN pExtSelectClipRgn; 
   PAINTCALLBACK_SELECTPALETTE pSelectPalette; 
   PAINTCALLBACK_REALIZEPALETTE pRealizePalette; 
   PAINTCALLBACK_GETGRAPHICSMODE pGetGraphicsMode; 
   PAINTCALLBACK_GETWORLDTRANSFORM pGetWorldTransform; 
   PAINTCALLBACK_ISCOMPATIBLEDC pIsCompatibleDC; 
   PAINTCALLBACK_CONVERTLINE pConvertLine; 
   PAINTCALLBACK_GETDIBINFO pGetDibInfo; 
   PAINTCALLBACK_PREPAINT pPrePaint; 
   PAINTCALLBACK_POSTPAINT pPostPaint; 
   PAINTCALLBACK_FILLRECT pFillRect; 
} PAINTCALLBACKDATA, * pPAINTCALLBACKDATA; 

The PAINTCALLBACKDATA structure describes the format of PAINTCALLBACKDATA, * pPAINTCALLBACKDATA;

The PAINTCALLBACKDATA structure contains the callbacks used for custom painting.

The following functions make use of this structure:

L_PaintDCCallback

L_PaintRgnDCCallback

L_PaintDCBufferCallback

L_PaintRgnDCBufferCallback

L_PaintDCOverlayCallback

Member Description
uStructSize Size of the PAINTCALLBACKDATA structure. This should be sizeof(PAINTCALLBACKDATA).
uFlags Any of the following flags. (You can use a bitwise OR to specify more than one value.).
  Value Meaning
  PAINTCALLBACKDATA_NO_INDEXEDPAINT [0x00000001] Do not use indexed paint. The palette colors should be passed as RGB colors, not palette indices.
pDisplay The device context to paint on. The predefined callbacks expect this value to be a valid DC handle. But, if you redirect all the callbacks, this can be a pointer to any structure you want. This value will be passed to all the paint callbacks that take a pDisplay parameter.
pUserData Pointer to a user-defined structure that will be passed to all the callback functions as the pUserData parameter.
pGetDeviceCaps Pointer to a function that will replace the GetDeviceCaps GDI function.
pGetMapMode Pointer to a function that will replace the GetMapMode GDI function.
pSetStretchBltMode Pointer to a function that will replace the SetStretchBltMode GDI function.
pIntersectClipRect Pointer to a function that will replace the IntersectClipRect GDI function.
pSaveDC Pointer to a function that will replace the SaveDC GDI function.
pRestoreDC Pointer to a function that will replace the RestoreDC GDI function.
pStretchDIBits Pointer to a function that will replace the StretchDIBits GDI function.
pSetViewportOrgEx Pointer to a function that will replace the SetViewportOrgEx GDI function.
pGetViewportOrgEx Pointer to a function that will replace the GetViewportOrgEx GDI function.
pExtSelectClipRgn Pointer to a function that will replace the ExtSelectClipRgn GDI function.
pSelectPalette Pointer to a function that will replace the SelectPalette GDI function.
pRealizePalette Pointer to a function that will replace the RealizePalette GDI function.
pGetGraphicsMode Pointer to a function that will replace the GetGraphicsMode GDI function.
pGetWorldTransform Pointer to a function that will replace the GetWorldTransform GDI function.
pIsCompatibleDC Pointer to a function that determines whether the DC and bitmap are compatible with my callbacks.
pConvertLine Pointer to a function that converts the image data to display data.
pGetDibInfo Pointer to a function that will tell the raster engine the format of display data. This function must be provided if you provide the pConvertLine function.
pPrePaint Pointer to a function that can be used for initialization.
pPostPaint Pointer to a function that can be used for cleanup.
pFillRect Pointer to a function that will replace the FillRect GDI function.

Comments

You do not need to provide every callback. You can set to NULL any callbacks that you do not wish to replace. If you pass NULL for a certain callback, the default GDI function will be used.

If you do pass NULL for some of the GDI callbacks, then you should set pDisplay to a valid HDC handle. The default GDI functions expect pDisplay to be a HDC handle.

If you set pIsCompatibeDC to a valid function pointer, that function will be called before any other callback function to determine whether the DC is compatible with your callbacks. If this function returns FALSE, then no other callback will be called and the default GDI functions will be used.

If you set pConvertLine to a valid function pointer, you must also set pGetDibInfo to a valid function pointer so LEADTOOLS will know the format of the image data expected by the painting functions.

If you set pPrePaint to a valid function pointer, it will be called once after pIsCompatibleDC and before any other callback.

If you set pPostPaint to a valid function pointer, it will be called once any other callback.

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help