LAnimationWindow::Load
#include "ltwrappr.h"
L_INT LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)
L_INT LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)
L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)
L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)
L_TCHAR * 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 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: |
|
Topics: |
|
|
Example
This is an example for LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):
L_INT LAnimationWindow_LoadFirstExample(HWND hWnd) { L_INT nRet; LAnimationWindow AnimationWindow; AnimationWindow.SetFileName(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\eye.gif")); nRet = AnimationWindow.Load(8, ORDER_BGR, 1); if (nRet ==SUCCESS) { AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300); nRet = AnimationWindow.PlayAnimation(); if(nRet != SUCCESS) return nRet; while (AnimationWindow.IsPlaying()) { if (AnimationWindow.DoEvents()) break; } } else return nRet; return SUCCESS; } /*This is an example for LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/ L_INT LAnimationWindow_LoadSecondExample(HWND hWnd) { L_INT nRet; LAnimationWindow AnimationWindow; AnimationWindow.SetFileName(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\eye.gif")); nRet = AnimationWindow.Load(8, ORDER_BGR, NULL); if ( nRet==SUCCESS) { AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300); nRet = AnimationWindow.PlayAnimation(); if(nRet != SUCCESS) return nRet; while (AnimationWindow.IsPlaying()) { if (AnimationWindow.DoEvents()) break; } } else return nRet; return SUCCESS; } /*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):*/ L_INT LAnimationWindow_LoadThirdExample(HWND hWnd) { L_INT nRet; LAnimationWindow AnimationWindow; nRet = AnimationWindow.Load(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\eye.gif"), 8, ORDER_BGR, 5) ; if (nRet==SUCCESS) { AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300); nRet = AnimationWindow.PlayAnimation(); if(nRet != SUCCESS) return nRet; while (AnimationWindow.IsPlaying()) { if (AnimationWindow.DoEvents()) break; } } else return nRet; return SUCCESS; } /*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/ L_INT LAnimationWindow_LoadForthExample(HWND hWnd) { L_INT nRet; LAnimationWindow AnimationWindow; nRet = AnimationWindow.Load(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\eye.gif"), 8, ORDER_BGR, NULL); if (nRet==SUCCESS) { AnimationWindow.CreateWnd(hWnd,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300); nRet = AnimationWindow.PlayAnimation(); if(nRet != SUCCESS) return nRet; while (AnimationWindow.IsPlaying()) { if (AnimationWindow.DoEvents()) break; } } else return nRet; return SUCCESS; }