L_INT LAnimationWindow::SetPosition(nLeft, nTop, nIndex=ANIM_ALL_ITEMS)
Sets the left and top positions for the bitmap item at position nIndex inside the bitmaplist.
X coordinate for the origin of the bitmap list item.
Y coordinate for the origin of the bitmap list item.
Position of bitmap list item. Possible values are:
Value | Meaning |
---|---|
ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list |
>=0 | Set the delay only for the specified item |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
If nIndex = ANIM_ALL_ITEMS, then all bitmap list items will be affected by the new position.
Win32, x64.
This example iterates through all bitmap items, gets the current position
for each bitmap using GetPosition method, displays it, sets the new
position using SetPosition so that the images will be shifted diagonally.
L_INT LAnimationWindow_SetDisposalMethodExample(HWND hWndParent)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB);
//make sure all libraries are loaded
LAnimationWindow MyAnimation;
MyAnimation.SetFileName(MAKE_IMAGE_PATH(TEXT("eye.gif")));
nRet = MyAnimation.Load();
if (nRet==SUCCESS)
{
L_INT nLeft, nTop;
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//change the bitmaps positions
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];
//get current position for each bitmap
nRet = MyAnimation.GetPosition(&nLeft, &nTop, i);
if(nRet != SUCCESS)
return nRet;
wsprintf(szStr,TEXT("GetPosition[%d] : Left = %d and Top = %d"),i, nLeft, nTop);
MessageBox(hWndParent, szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
nLeft +=i;
nTop +=i;
//update current position
nRet = MyAnimation.SetPosition(nLeft, nTop, i);
if(nRet != SUCCESS)
return nRet;
wsprintf(szStr,TEXT("SetPosition[%d] : Left = %d and Top = %d"),i, nLeft, nTop);
MessageBox(hWndParent, szStr,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