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


DaVinci ipExportInd function: Export of graphics

The ipExportInd function exports a DIB, metafile or enhanced metafile used internally with DaVinci in one the supported output formats.

IPERROR FAR PASCAL	ipExportInd(
LPDAVPARAMS lpDavParams);

lpDavParams LPDAVPARAMS Pointer to a DAVPARAMS structure containing the specifications of the image to be exported.

Return value

Returns 0 on success; otherwise returns an error corresponding to one of the IPE_xxxx error codes.

Remarks

Applications using this function must fill in the appropriate members of the DAVPARAMS structur before calling ipExportInd.

Applications only need to fill in DAVPARAMS members required for the actual conversion. All other fields should be set to 0.

The following members must be assigned appropriate values prior to executing ipExportInd:

The ipExportInd function does not free the handles transfered. The application is responsible for freeing the memory allocated by the handles by calling GlobalFree, DeleteMetaFile and DeleteEnhMetaFile respectively.

Example: File export using a file save dialog to allow user specification of filename and type.
/* FrameCMFileSave
 *
 * Save a graphic file in another format
 */
void static FrameCMFileSave(HWND hWnd)
{
  METARESOLUTION        mr;
  HDIB                  hDIB        = (HDIB)        SendMessage(hwClient, IMM_GETDIB     , 0, 0L);
  HMETAFILE             hMetaFile   = (HMETAFILE)   SendMessage(hwClient, IMM_GETMETAFILE, 0, (LPARAM)(LPSTR)&mr);
# ifdef __WIN32__
  HENHMETAFILE          hEnhMetaFile= (HENHMETAFILE)SendMessage(hwClient, IMM_GETENHMETAFILE, 0, 0);
# endif
  DAVPARAMS             DavParams;

# ifdef __WIN32__
  if (hDIB || hMetaFile || hEnhMetaFile)
# else
  if (hDIB || hMetaFile)
# endif
  {
     memset(&DavParams, 0, sizeof(DavParams));
     DavParams.dwStructSize  = sizeof(DAVPARAMS);
     DavParams.dwFlags       = IPF_DIB | IPF_META | IPF_MSGBOX | IPF_COMPRESS | IPF_FILEDIALOG;  // Ask for filename, display error messages, all data firmats, compress if possible
     DavParams.lpszFileName  = NULL;                    // Ask for filename from user
     DavParams.dwFileType    = IPT_SELECT;              // Ask user for file type
     DavParams.hDIB          = hDIB;							// Metafile handle
     DavParams.hMetaFile     = hMetaFile;               // metafile handle
     DavParams.MetaResolution= mr;                      // Metric size definition
#    ifdef __WIN32__
     DavParams.hEnhMetaFile	 = hEnhMetaFile;					// enhanced metafile handle
#    endif
     ipExportInd(&DavParams);
  }

} // FrameCMFileSave

See also:

ÞipImportExt

Þ IpInportInd

Þ SaveDIBToFile