SetFocusedIndexSync Method (ImageViewer)
This example shows how to start animation in
ImageViewer if image viewer uses images from
Images property.
''' <summary>
''' Shows animation in image viewer.
''' </summary>
''' <param name="viewer">An image viewer.</param>
''' <param name="delay">The animation delay in milliseconds.</param>
Private Sub ShowAnimation(viewer As Vintasoft.Imaging.UI.ImageViewer, delay As Integer)
' for each image in image collection of image viewer
For i As Integer = 0 To viewer.Images.Count - 1
' change image in image viewer
viewer.SetFocusedIndexSync(i)
' sleep for a while
System.Threading.Thread.Sleep(delay)
Next
End Sub
/// <summary>
/// Shows animation in image viewer.
/// </summary>
/// <param name="viewer">An image viewer.</param>
/// <param name="delay">The animation delay in milliseconds.</param>
private void ShowAnimation(Vintasoft.Imaging.UI.ImageViewer viewer, int delay)
{
// for each image in image collection of image viewer
for (int i = 0; i < viewer.Images.Count; i++)
{
// change image in image viewer
viewer.SetFocusedIndexSync(i);
// sleep for a while
System.Threading.Thread.Sleep(delay);
}
}
Target Platforms: .NET 6; .NET 5; .NET Core 3.1; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5