GRAYSCALEDLGPARAMS

typedef struct _GRAYSCALEDLGPARAMS
{
   L_UINT uStructSize;
   pBITMAPHANDLE pBitmap;
   L_BOOL bZoomToFit;
   L_INT nRedFactor;
   L_INT nGreenFactor;
   L_INT nBlueFactor;
   L_UINT32 uDlgFlags;
   LTCOMMDLGHELPCB pfnHelpCallback;
   L_VOID *pHelpCallBackUserData;
} GRAYSCALEDLGPARAMS,* LPGRAYSCALEDLGPARAMS;

The GRAYSCALEDLGPARAMS structure provides information used to initialize the dialog box created by the L_DlgGrayScale function. After the user closes the dialog box, this structure is updated with information about the user's selections.

Member

Description

uStructSize

Size of this structure, in bytes. Use the sizeof operator to calculate this value.

pBitmap

Pointer to the bitmap handle that references the bitmap used for preview or processing.

bZoomToFit

Flag that indicates the initial zoom level for previewing the image. Possible values are:

 

Value

Meaning

 

TRUE

Set the initial zoom level to "Zoom to fit".

 

FALSE

Set the initial zoom level to "Normal (1:1)".

 

nRedFactor

Value that represents the percentage or weight given to the red value of each pixel in the bitmap. Possible values are (0-1000), nRedFactor + nGreenFactor + nBlueFactor must equal 1000.

nGreenFactor

Value that represents the percentage or weight given to the green value of each pixel in the bitmap. Possible values are (0-1000), nRedFactor + nGreenFactor + nBlueFactor must equal 1000.

nBlueFactor

Value that represents the percentage or weight given to the blue value of each pixel in the bitmap. Possible values are (0-1000), nRedFactor + nGreenFactor + nBlueFactor must equal 1000.

uDlgFlags

User interface flags for this dialog, which determine the layout and action of the dialog. Possible values are:

 

Value

Meaning

 

DLG_GRAYSCALE_AUTOPROCESS

[0x00000001] process the image on OK. The pBitmap member of this structure should contain a valid bitmap.

 

DLG_GRAYSCALE_SHOW_CONTEXTHELP

[0x00000002] dialog should contain a context sensitive help icon.

 

DLG_GRAYSCALE_SHOW_PREVIEW

[0x00000004] show a preview of the image in the dialog. The pBitmap member of this structure should contain a valid bitmap.

 

DLG_GRAYSCALE_SHOW_TOOL_ZOOMLEVEL

[0x00000008] show the "Zoom to fit" and "Zoom Normal" toolbar buttons. The DLG_GRAYSCALE_SHOW_PREVIEW flag must be set in order to show these buttons.

pfnHelpCallback

Pointer to an optional help callback function. If you do not wish to provide help to this dialog, use NULL as the value of this parameter. To provide help to this dialog, use the function pointer as the value of this parameter. The callback function must adhere to the prototype described in LTCOMMDLGHELPCB.

pHelpCallBackUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs. To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pHelpCallBackUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.