public void CancelWait()
- (BOOL)cancelWait:(NSError **)error;
public:
void CancelWait();
def CancelWait(self):
The "Wait for user input" is supported by GIF89a and later standard. This flag gets set to the corresponding value if this image was loaded from a GIF file. Also, the value set in this property will be used if this image is saved as a GIF file. Otherwise, the LEADTOOLS toolkit will not use the value of this property.
This flag is set in the RasterImage.AnimationWaitUserInput property. The animation playback engine will get into a wait state if it encounters this flag in a frame and the state of the playback will be RasterImageAnimatorState.WaitInput. Use the CancelWait method to exit the wait state and move to the next frame
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.Drawing;
RasterImageAnimator _animator;
RasterImage _targetImage;
Graphics _graphics;
LeadRect _destRect;
RasterPaintProperties _paintProperties;
public void RasterImageAppendExample(Panel panel)
{
// Initialize the RasterCodecs object
RasterCodecs codecs = new RasterCodecs();
// An animated GIF file
string fileName = Path.Combine(LEAD_VARS.ImagesDir, "Eye.gif");
// load the first frame, so we have the palette and a target image for playback
_targetImage = codecs.Load(fileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1);
// Create the animator
_animator = new RasterImageAnimator(_targetImage, null);
// Setup our class members used in the event handler
_graphics = panel.CreateGraphics();
_destRect = LeadRect.FromLTRB(panel.ClientRectangle.Left, panel.ClientRectangle.Top, panel.ClientRectangle.Right, panel.ClientRectangle.Bottom);
_paintProperties = RasterPaintProperties.Default;
_paintProperties.PaintEngine = RasterPaintEngine.GdiPlus;
// Hook to the LoadImage event and load the file
codecs.LoadImage += new EventHandler<CodecsLoadImageEventArgs>(Codecs_LoadImage);
codecs.Load(fileName);
codecs.LoadImage -= new EventHandler<CodecsLoadImageEventArgs>(Codecs_LoadImage);
_graphics.Dispose();
_animator.Dispose();
_animator = null;
_targetImage.Dispose();
codecs.Dispose();
}
void Codecs_LoadImage(object sender, CodecsLoadImageEventArgs e)
{
if ((e.Flags & CodecsLoadImageFlags.FirstRow) == CodecsLoadImageFlags.FirstRow)
_animator.Append(e.Image);
_animator.ValidateLines(e.Row, e.Lines);
RasterImageAnimatorState state = _animator.State;
while (state != RasterImageAnimatorState.End)
{
state = _animator.Process();
LeadRect updateRect;
switch (state)
{
case RasterImageAnimatorState.WaitInput:
_animator.CancelWait();
break;
case RasterImageAnimatorState.PostClear:
case RasterImageAnimatorState.PostRender:
updateRect = _animator.GetUpdateRectangle(true);
RasterImagePainter.Paint(_targetImage, _graphics, LeadRect.Empty, updateRect, _destRect, LeadRect.Empty, _paintProperties);
break;
}
break;
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
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