FILESAVECALLBACK

Summary

Provides input to the LFile::SaveFile, LFile::SaveFile, LFile::SaveOffset, LDicomDS::InsertImage, and LDicomDS::SetImage functions.

Syntax

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, pBuffer, uRow, uLines, pUserData)

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle that contains the image information.

L_UCHAR * pBuffer

Pointer to the caller's input buffer where the callback function must put the data.

L_UINT uRow

The number of the first line that the callback function must put in the buffer.

L_UINT uLines

The number of lines that the callback function must put in the buffer.

L_VOID * pUserData

A 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 calling function.)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This type callback function is optional. If you provide a callback function, it must supply the image data. It can also do other useful things, such as updating a status bar. If you do not provide a callback function, the calling function saves data from the specified bitmap.

Platforms

Win32, x64

See Also

Functions

Example

This FILESAVECALLBACK function supplies image data from the LEAD bitmap
to fulfill the minimum requirements of the callback

L_INT EXT_CALLBACK SaveImageCB (pBITMAPHANDLE pBitmap, 
                                L_UCHAR     * pBuffer, 
                                L_UINT        nRowBegin, 
                                L_UINT        nRowsToGet, 
                                L_VOID       * pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   UNREFERENCED_PARAMETER(pBuffer); 
   UNREFERENCED_PARAMETER(pBitmap); 
 
   L_UINT i; /* Row counter */ 
   L_UINT nRowLast = nRowBegin + nRowsToGet; /* Used when counting rows */ 
   L_TCHAR szMessage [50]; 
 
   /* Put the required rows in the buffer */ 
   for (i = nRowBegin; i < nRowLast; i++) 
   { 
      wsprintf(szMessage, TEXT("Row no. %u\n"),i);  
      MessageBox(NULL, szMessage, TEXT("Row"), MB_OK ); 
   } 
   return (SUCCESS); 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.