LAnimationWindow::Load

#include "ltwrappr.h"

virtual L_INT LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

L_TCHAR L_FAR * pszFileName;

/* name of the file to load */

L_INT nBitsPerPixel;

/* number of bits per pixel for the playback bitmap */

L_INT nColorOrder;

/* color order of the playback bitmap */

L_INT nPage;

/* page number */

pLOADFILEOPTION pLoadFileOption;

/* pointer to optional extended load options */

pFILEINFO pFileInfo;

/* pointer to a structure */

Loads an image file into the animation object.

Parameter

Description

pszFileName

Character string containing the name of the file to load.

nBitsPerPixel

Number of bits per pixel for the playback bitmap.

nColorOrder

Color order of the playback bitmap. Possible values are:

 

Value

Meaning

 

ORDER_RGB

[0] The input colors are in red-green-blue order.

 

ORDER_BGR

[1] The input colors are in blue-green-red order.

 

ORDER_GRAY

[2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical toolkits.

nPage

Page number to load from a multi page file. The first page is number 1. If the file is an animated GIF file or an AVI, this is the first page to load. If this is not an animation file, then the function will load page number nPage from the file.

pLoadFileOption

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

pFileInfo

Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.

 

If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of LFile::GetInfo.

 

If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.

 

If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function loads a file into the animation object. If the file is an animated GIF or AVI, then the bitmap list will be loaded with all the images from the file starting at nPage. If the file is not an animated GIF or AVI, then the function will load the page specified by nPage.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LFileSettings::SetWMFResolutionExt, Class Members

Topics:

Raster Image Functions: Playing Animated Images

 

Implementing Animation

Example

/*This is an example for LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad1(HWND hWnd)
{
   
LAnimationWindow AnimationWindow;

   LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
   
AnimationWindow.SetFileName(TEXT("d:\\ltwin14x\\images\\eye.gif"));

   
if (AnimationWindow.Load(8, ORDER_BGR, 1) ==SUCCESS)
   
{
      
AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
      
AnimationWindow.PlayAnimation();
      
while (AnimationWindow.IsPlaying())
      
{
         
if (AnimationWindow.DoEvents())
            
break;
      
}
   
}
}

/*This is an example for LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad2(HWND hWnd)
{
   
LAnimationWindow AnimationWindow;
   
LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
   
AnimationWindow.SetFileName(TEXT("d:\\ltwin14x\\images\\eye.gif"));

   
if (AnimationWindow.Load(8, ORDER_BGR, NULL) ==SUCCESS)
   
{
      
AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
      
AnimationWindow.PlayAnimation();
      
while (AnimationWindow.IsPlaying())
      
{
         
if (AnimationWindow.DoEvents())
            
break;
      
}
   
}
}

/*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad3(HWND hWnd)
{
   
LAnimationWindow AnimationWindow;
   
LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
   
if (AnimationWindow.Load(TEXT("d:\\ltwin14x\\images\\eye.gif"), 8, ORDER_BGR, 5) ==SUCCESS)
   
{
      
AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
      
AnimationWindow.PlayAnimation();
      
while (AnimationWindow.IsPlaying())
      
{
         
if (AnimationWindow.DoEvents())
            
break;
      
}
   
}
}

/*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad4(HWND hWnd)
{
   
LAnimationWindow AnimationWindow;
   
LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
   
if (AnimationWindow.Load(TEXT("d:\\ltwin14x\\images\\eye.gif"), 8, ORDER_BGR, NULL) ==SUCCESS)
   
{
      
AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
      
AnimationWindow.PlayAnimation();
      
while (AnimationWindow.IsPlaying())
      
{
         
if (AnimationWindow.DoEvents())
            
break;
      
}
   
}
}