Gets an LBitmapBase object that references a bitmap in the class object's bitmap list.
#include "ltwrappr.h"
L_INT LAnimationWindow::GetAt(nIndex, pBitmap, bReflectIndex = FALSE)
Position of the bitmap in the list. Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.
Pointer to the bitmap handle that will reference the bitmap in the list.
Flag that indicates whether to set the current index to the passed index. Possible values are:
Value | Meaning |
---|---|
TRUE | Set the class objects current index to the passed index. |
FALSE | Do not set the class objects current index to the passed index. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The bitmap handle that this method gets is a copy of the bitmap handle stored internally in the list. If you modify the bitmap using this handle, you can update the internal bitmap handle to reflect the changes by using the LAnimationWindow::SetAt method.
You cannot use this method to update a bitmap list while it is being used in an animation playback.
Win32, x64.
/*<documentation/>*/
class MyAnimationWindow : public LAnimationWindow
{
public :
L_INT GetFrame(L_UINT nIndex, LBitmapBase * pBitmap, L_BOOL bReflectIndex = FALSE)
{
return GetAt(nIndex, pBitmap, bReflectIndex);
}
L_INT SetFrame(L_UINT nIndex, LBitmapBase * pBitmap, L_BOOL bReflectIndex = FALSE)
{
return SetAt(nIndex, pBitmap, bReflectIndex);
}
L_INT InsertFrame(LBitmapBase * pBitmap, L_UINT nIndex)
{
return LAnimationWindow::InsertFrame(pBitmap, nIndex);
}
L_INT RemoveFrame(L_UINT nIndex, LBitmapBase * pBitmap)
{
return LAnimationWindow::RemoveFrame(nIndex,pBitmap);
}
};
L_INT LAnimationWindow_GetAtExample(HWND hWndParent)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB);
//make sure all libraries are loaded
MyAnimationWindow MyAnimation;
LBitmapBase bitmap;
LBitmapBase newBitmap;
LBitmapBase removedBitmap;
MyAnimation.SetFileName(MAKE_IMAGE_PATH(TEXT("eye.gif")));
nRet = MyAnimation.Load();
if (nRet!=SUCCESS)
return nRet;
//Flip the first frame
MyAnimation.GetFrame(0, &bitmap, FALSE);
bitmap.Flip();
MyAnimation.SetFrame(0, &bitmap, FALSE);
//Remove the last frame, and replace it with new bitmap
nRet = MyAnimation.RemoveFrame(MyAnimation.GetCount()-1, NULL);
if (nRet!=SUCCESS)
return nRet;
nRet = newBitmap.Load(MAKE_IMAGE_PATH(TEXT("image4.gif")));
if (nRet!=SUCCESS)
return nRet;
nRet = MyAnimation.InsertFrame(&newBitmap, (L_UINT)-1);
// Replace the second item with new bitmap;
if (nRet==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
nRet = MyAnimation.MoveToFrame(i);
if(nRet != SUCCESS)
return nRet;
if (MyAnimation.IsFirstFrame())
{
MessageBox(hWndParent, TEXT("First frame..."),TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
else
if (MyAnimation.IsLastFrame())
{
MessageBox(hWndParent, TEXT("Last frame..."),TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}
else
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document