←Select platform

AnimationLoop Property

Summary

Gets the number of times this animation loops.

Syntax
C#
Objective-C
C++/CLI
Java
Python
public int AnimationLoop { get; } 
@property (nonatomic, assign, readonly) NSUInteger animationLoop; 
public int getAnimationLoop() 
public: 
property int AnimationLoop { 
   int get(); 
} 
AnimationLoop # get  (CodecsWebpImageInfo) 

Property Value

Non-zero if the animation loops a limited number of times. If zero, the animation loops indefinitely. The default value is 0.

Remarks

This property should be used only if CodecsWebpImageInfo.HasAnimationLoop = true. If CodecsWebpImageInfo.HasAnimationLoop = false, the animation should loop and this property should be ignored.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
 
 
 
public void TestWebpInfoExample() 
{ 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      string srcFile = Path.Combine(LEAD_VARS.ImagesDir, "test_stamp240x200-q120.webp"); 
      using (CodecsImageInfo info = codecs.GetInformation(srcFile, true)) 
      { 
         Debug.WriteLine($"File format: {info.Format}, Size: {info.Width} x {info.Height} x {info.BitsPerPixel}"); 
         Debug.WriteLine($"HasAlpha: {info.HasAlpha}"); 
         if (info.Format == RasterImageFormat.WebpAni) 
         { 
            // CodecsWebpImageInfo reference 
            Debug.WriteLine($"Webp animation width: {info.Webp.AnimationWidth}"); 
            Debug.WriteLine($"Webp animation width: {info.Webp.AnimationHeight}"); 
            if (info.Webp.HasAnimationBackground) 
               Debug.WriteLine($"File has animation background color: {info.Webp.AnimationBackground.ToString()}"); 
            else 
               Debug.WriteLine($"File does not have background color"); 
            if (info.Webp.HasAnimationLoop) 
               Debug.WriteLine($"File has animation loop count: {info.Webp.AnimationLoop}"); 
            else 
               Debug.WriteLine($"File does not have animation loop"); 
         } 
      } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.