TMlSkinAnimation

A frame-by-frame animation control that plays a set of images in sequence, much like a GIF.

Category
Panels & containers
Unit
uMlSkinAnimation.pas
Inherits from
TMlSkinCustomAnimation → TMlSkinCustomControl

Notes

  • The frames live in Images (an ImageList) and play in order.
  • Delay is the interval between frames in milliseconds, Loop repeats the sequence and Reverse plays it backwards.
  • CurrentFrame reads and sets the current frame, which lets you position the animation by hand.
  • OnFinish fires at the end of a pass and OnProcess on every frame change.

Example

From the demo MlSkin.Demo.动画演示.v3.0 (.dfm form file)

object MlSkinAnimation1: TMlSkinAnimation
  Left = 87
  Top = 200
  Width = 46
  Height = 47
  CurrentFrame = 0
  Images = il1
  Delay = 50
  DoubleBuffered = False
end

Properties 7

NameTypeDefaultDescription
CurrentFrameInteger—The frame currently on screen; read or write it to position the animation by hand.
AutoSizeBooleanTrueWhether the control resizes itself to fit its content.
ImagesTCustomImageList—The ImageList holding the animation frames, played in list order.
DelayInteger68Interval between frames in milliseconds; smaller values play faster.
LoopBooleanTrueWhether playback repeats; with it off the animation stops on the last frame.
ReverseBooleanFalsePlays the frames in reverse order.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.

Events 2

NameTypeDefaultDescription
OnProcessTNotifyEvent—Fires on every frame change.
OnFinishTNotifyEvent—Fires when a pass through the frames finishes.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
AboutTMlAboutInfo—A design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
OnDPIChangedTMlDPIChangedEvent—Fires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself.
OnBackgroundChangingTMlBackgroundEvent—Fires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEvent—Fires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEvent—Fires when the control is shown or hidden.

Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.

Offline helpA PDF / CHM version is available for offline reading.