| Herd Software Development
DaVinci Graphics Library
DaVinci Documentation Home Search Order

The DAVPARAMS structure

The DAVPARAMS structure is used for data exchange between the calling application and DaVinci during import or export operations.
typedef struct {
// Filled by the application program
DWORD	dwStructSize;
LPARAM	lParam;
DWORD	dwFlags;
HMMIO	hmmio;
UINT	uPageNumber;
LPSTR	lpszFileName;
DWORD	dwFileType;
LPSTR	lpszFltFileName;
int	iDxfRotAngle;
int	iDxfScale;
HWND	hwOwner;
POINT	ptMetaDIBResolution;

// return values from Import; application-defined values when used for Export.
#ifdef __WIN32__

// Additional informations
DWORD	dwDxfFlags;
DWORD	dwTransparentColorIndex;
BYTE	abReserved[52];

DAVPARAMS structure has the following members:

Field Type Description
dwStructSize DWORD Size of the DAVPARAMS structure in bytes. Applications should always define the size of this structure using sizeof(DAVPARAMS) before calling DaVinci functions.
lParam LPARAM Application-defined 32 bit value for use by the procedure defined in fnCallBackProc.
fnCallBackProc IPCALLBACKPROC Application-defined callback function which is periodically called by DaVinci during the import/export, most commonly the procedure in the calling application which controls progress indicators and gauges.
dwFlags DWORD IPF_xxxx flag values with logical or combined values.
hmmio HMMIO Handle to a file opened using the MMSYSTEM API.
uPageNumber Int Page number, used when importing multi-page TIFF files (1...number of pages in file). If uPageNumber is 0 and the TIFF file to be imported contains several pages, DaVinci will prompt the user for the page to import. The calling application can retrieve the number of the pages in a TIFF file using the ipTifPageCount function.

DaVinci Standard always imports the first page.

lpszFileName LPSTR The name of the file to be imported.
dwFileType DWORD IPT_xxxx file type, most commonly entered as IPT_SELECT.
lpszFltFileName LPSTR File name of the .FLT import filter which will be used if dwFileType = IPT_FLT.
iDxfRotAngle Int Specifies the angle of rotation for imported DXF files.
iDxfScale Int Specifies the scale factor for imported DXF files.
hwOwner HWND Handle of the calling application’s window which will act as parent for file dialogs, the progress indicator box, and error messages.
ptMetaDIBResolution POINT Size specification used for converting metafile data to DIB data. The value corresponds to the pixels-per-inch desired in the output DIB.
hDIB HDIB Handle of the DIB to be exported or handle of the imported DIB.
hMetaFile HMETAFILE Handle of the metafile’s to be exported or handle of the imported metafile.
hEnhMetaFile HENMETAFILE Applicable only to the 32 bit version of DaVinci. Handle of the enhanced metafile to be exported or imported.
MetaResolution METARESOLUTION Structure with metric size specifications of hMetaFile should be filled if hMetaFile is not NULL on export.
dwDxfFlags DWORD Supplementary IPDXF_xxxx option flags for DXF import.
dwDIBFlags DWORD Additional IPDIBF_xxxx - Flags used to define the Type of the DIB to be created when importing Bitmap files. (32-Bit, CMYK, RGBA and so on.)
dwTransparentColorIndex DWORD Defines transparency for GIF/PNG import/export. On non-ztransparent images this entry is zero. If the image has a transparent color, bit 31 is set and the lower 8 Bits define the index into the color palette defining the transparent color. Note that PNG images allow transparent images both as RGBA-Images and as indexed transparency.
abReserved BYTE [52] 52 bytes allocated to insure forward compatibility with future extensions to DaVinci


The functions ipImportInd and ipExportIndare provided to reduce the passing of DAVPARAMS structures to DaVinci into simple function calls.

The calling application can predefine a pointer to a DAVPARAMS structure when using these functions, but is permitted to do so only when using these functions. All other DaVinci functions require the allocation of a pointer to a DAVPARAMS structure by using the function ipDavParamsAlloc. This is critical to insure safe release of allocated memory with any future DaVinci updates.

Any members of the DAVPARAMS structure which are not required by the application should be initialized as 0. The dwStructSize member should always be defined as outlined above.


C example

memset(&par, 0, sizeof(par));
par.dwStructSize = sizeof(par);

PASCAL example

var par	: DAVPARAMS;
   FillChar(par, sizeof(par), 0);
   par.dwStructSize := sizeof(par);