PNGWEBTUNERDLGPARAMS

Summary

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

Syntax

typedef struct _PNGWEBTUNERDLGPARAMS 
{ 
   L_UINT uStructSize; 
   pBITMAPHANDLE pBitmap; 
   L_BOOL bZoomToFit; 
   COLORREF crTransparent; 
   L_INT nPalType ; 
   L_BOOL bAddWindowsColors ; 
   L_INT nDitherType ; 
   L_INT nBitsPerPixel ; 
   L_INT nNumOfColors ; 
   L_INT nTransparencyTolerance ; 
   L_BOOL bTransparent ; 
   L_UINT32 uDlgFlags ; 
   LTCOMMDLGHELPCB pfnHelpCallback; 
   L_VOID *pHelpCallBackUserData ; 
} PNGWEBTUNERDLGPARAMS, * LPPNGWEBTUNERDLGPARAMS ; 

Members

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)".

crTransparent

The color that will be transparent in the PNG image. This color is in RGB.

nPalType

Value that indicates the type of palette to use. Possible values are:

Value Meaning
CRF_FIXEDPALETTE Use the fixed palette.
CRF_OPTIMIZEDPALETTE Create an optimized palette.

bAddWindowsColors

Flag that indicates whether to use the identity palette. Possible values are:

Value Meaning
TRUE Use the identity palette.
FALSE Do not use the identity palette.

nDitherType

Flag that indicates the dithering type to use. Possible values are:

Value Meaning
CRF_NODITHERING Use nearest color matching
CRF_FLOYDSTEINDITHERING Use Floyd-Steinberg dithering
CRF_STUCKIDITHERING Use Stucki dithering
CRF_BURKESDITHERING Use Burkes dithering
CRF_SIERRADITHERING Use Sierra dithering
CRF_STEVENSONARCEDITHERING Use Stevenson Arce dithering
CRF_JARVISDITHERING Use Jarvis dithering
CRF_ORDEREDDITHERING Use ordered dithering, which is faster but less accurate than other dithering methods.
CRF_CLUSTEREDDITHERING Use clustered dithering

nBitsPerPixel

The bits per pixel for the tuned bitmap. Valid values are: 1, 4, 8, 24, and 32 bpp.

nNumOfColors

When nBitsPerPixel is 8 or less (the image is using indexed colors), this value represents the maximum number of colors that the PNG image can have. Possible values range from 2 to 256. Indexed PNG images can have from 2 colors to 256 colors. Using fewer colors results in smaller files, but also reduces the quality of the image.

nTransparencyTolerance

A tolerance value that determines how close a pixel's RGB value should be to the specified transparent color to be considered transparent. A tolerance of 0 means only the transparent color specified in crTransparent will be considered transparent. Specifying larger numbers will make more of the image transparent. Valid values are from 0 to 255.

bTransparent

Flag that indicates whether the PNG image will have a transparent color. Possible values are:

Value Meaning
TRUE The PNG image will have a transparent color.
FALSE The PNG image will not have a transparent color.

✎ NOTE

Not all browsers are capable of presenting transparency for PNG images (especially for 24bit images).

uDlgFlags

User interface flags for this dialog which determines the layout and action of the dialog. This dialog does not support the Auto-Process feature; however it makes up for that by allowing the user to export tuned images directly from the dialog. This is done by setting the DIALOG_PNGWEBTUNER_SHOW_EXPORT flag. Possible values are:

Value Meaning
DLG_PNGWEBTUNER_SHOW_CONTEXTHELP [0x00000001] Dialog should contain a context sensitive help icon.
DLG_PNGWEBTUNER_SHOW_PREVIEW [0x00000002] Show a preview of the image in the dialog. The pBitmap member of this structure should contain a valid bitmap.
DLG_PNGWEBTUNER_SHOW_TOOL_ZOOMLEVEL [0x00000004] Show the "Zoom to fit" and "Zoom Normal" toolbar buttons. The DLG_PNGWEBTUNER_SHOW_PREVIEW flag must be set in order to show these buttons.
DLG_PNGWEBTUNER_SHOW_TOOL_COLORPICKER [0x00000008] Show the color button in the toolbar.
DLG_PNGWEBTUNER_SHOW_INFORMATION [0x00000010] Show the Information group of controls.
DLG_PNGWEBTUNER_SHOW_ADDWINDOWCOLOR [0x00000020] Show the Add Window Colors check box.
DLG_PNGWEBTUNER_SHOW_TRANSPARENCY [0x00000040] Show the Transparency group of controls.
DLG_PNGWEBTUNER_SHOW_EXPORT [0x00000080] Show the Export button instead of the OK button.
DLG_PNGWEBTUNER_SHOW_APPLY [0x00000100] Show the Apply button in the dialog. The dialog will not apply any effect unless the user presses the Apply button.

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.

Usage

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

LEADTOOLS Common Dialog C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.