LBitmapList::Save

#include "ltwrappr.h"

virtual L_INT LBitmapList::Save(lpszFile, nFormat, nBits, nQFactor, pSaveFileOption=NULL)

L_TCHAR L_FAR * lpszFile;

/* output file name */

L_INT nFormat;

/* output file format */

L_INT nBits;

/* resulting file's pixel depth */

L_INT nQFactor;

/* quality factor */

pSAVEFILEOPTIONpSaveFileOption;

/* pointer to optional extended save options */

Saves the class object's bitmap list in a multi-page file.

Parameter

Description

lpszFile

Character string containing the output file name.

nFormat

Output file format. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF). For possible values, refer to Formats of Output Files.

 

Single image formats are also valid (although only one image can be stored).

nBits

Resulting file's pixel depth. For possible values, refer to Formats of Output Files. If nBits is 0, the file will be stored using the closest BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 2, the file will be stored as 4 bit.

nQFactor

This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process. For possible values, refer to Compression Quality Factors.

pSaveFileOption

Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Single-image formats are also valid for output, but only the first image in the list is saved.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Topics:

Raster Image Functions: Playing Animated Images

 

Implementing Animation

Example

L_VOID TestLoadBitmapList(L_TCHAR L_FAR * pszFileName)
{
   LBitmapList BitmapList;
   LBitmap Bitmap;
   L_INT nCount, i;

   BitmapList.Load (pszFileName);
   nCount = BitmapList.GetItemsCount ();
   /* Change the hue of each bitmap in the list, 
   and restore the transparent color as the last color in the palette */
   for (i = 0; i < nCount; ++i)
   {
      BitmapList.GetItem (i, &Bitmap, sizeof(BITMAPHANDLE));
      Bitmap.ChangeHue(i * 10);
      BitmapList.SetItem (i, &Bitmap);
   }
   //...
   BitmapList.Save (pszFileName, FILE_GIF, 8, 0, NULL);
}