Control Name | Unit | Class |
RX ANI File. | Animate | TAnimatedImage |
Description:
The TAnimatedImage component can display simple
animation sequences on the form on which it is placed.
Use the TAnimatedImage component to display a sequence of frames
with a set interval to create an animated image. You specify the
bitmap containing the frames in the Glyph
property. Set the Active
property to True and watch the animation.
You can use design-time component editor to load Windows animated cursors (ANI files) into the Glyph property.
The animation sequence is stored in the Glyph property. The bitmap may consist of a series of frames arranged one after the other (from left to right or from top to bottom, according to Orientation property value), while the Interval property controls the rate at which the frames are displayed. The NumGlyphs property specifies count of the frames in the image.
It is possible to define number of frames to be displayed in the present moment, during runtime based on the value of the property GlyphNum. You can also set this value during design time.
The property Opaque determines, whether the component will fill in a background under image by colour Color or it will be completely transparent. Component also includes properties similar to the properties TImage. You can also use a component TAnimatedImage for a drawing on the form of the transparent motionless images, for example, for overlay of the images against each other.
The TransparentColor property sets the color for which the form's color should be displayed instead of the bitmap color. When you set the Active property to True, the glyph starts to animate. The OnStart event is triggered when the animation started and the OnStop event is generated when the property Active sets to False.
To display the frame sequence at timed intervals (or in other words, animate the glyph):
- Set the Glyph property to the frame sequence.
- Set the NumGlyphs property desired frame numbers in the image.
- Set the TransparentColor and Opaque properties to control image transparency.
- Set the Interval property to the desired time interval between successive frames.
- Set the Active property to True.
- You can stop the animation sequence by setting the Active property to False.
See also:
RX
ANI file
(TAnimatedCursorImage) and RX Gif Animator (TRxGIFAnimator)
Property Active
Declaration: Active: Boolean;
Once the frame sequence is properly loaded in the Glyph variable and the properties NumGlyphs, GlyphNum, InactiveGlyph and Interval properties are set, setting Active property to True will cause the animation to start (and stop when the Active property is False).
Property Glyph
Declaration: Glyph: TBitmap;
The Glyph property holds the animation sequence frames . The frames should be in Windows Bitmap file format. The frames may be arranged in either vertical or horizontal fashion one after the other.
Property GlyphNum
Declaration: GlyphNum: Integer;
The GlyphNum property stores the frame number of the frame currently displayed. It can be set to the frame number which needs to be displayed while Active property is False.
Note: When the InactiveGlyph property is not equal to -1, the GlyphNum property value are ignored.
When setting this property, if the
value is within the acceptable range (between 0 and the number of
frames in the Glyph) the current frame display is changed.
Note: Before using this property, ensure that the
animation sequence if properly loaded into the Glyph property.
Property InactiveGlyph
Declaration: InactiveGlyph: Integer;
The InactiveGlyph property specifies the frame number of the frame displayed when Active is set to False. When the InactiveGlyph property value is equal to -1, the GlyphNum property can be set to the frame number which needs to be displayed. When InactiveGlyph is within the acceptable range (between 0 and the number of frames in the bitmap) then this value used to display the image in inactive (non-animated) state and this frame not used in during animation (i.e. when Active = True).
Property Interval
Declaration: Interval: Word;
The Interval property specifies in milliseconds the amount of time required between changing the frames of a TRxTrayIcon (32-bit only), TAnimatedImage or TRxDice animation; or speed of text scrolling in the TSecretPanel component.
Property NumGlyphs
Declaration: NumGlyphs: Integer;
The NumGlyphs property specifies the number of frames in the image contained in the Glyph property.
Property Opaque
Declaration: Opaque: Boolean;
Opaque specifies whether the background of the image obscures objects below the animated image object.
- Set Opaque to
False to allow objects behind the TAnimatedImage object
to show through the background of the bitmap.
- Set Opaque to True to make the background of the bitmap opaque. Opaque has no effect unless the TransparentColor property not equal to clNone.
Property Orientation
Declaration: Orientation: TGlyphOrientation;
Orientation determines whether the frames are placed horizontal or vertical fashion in the image specified by Glyph property of the TAnimatedImage component. It can either be goHorizontal or goVertical. The default value is goHorizontal.
Property TransparentColor
Declaration: TransparentColor: TColor;
TransparentColor determines which color of the bitmap is to be transparent when the frame is drawn. This property makes the frame partially transparent by setting the color in the bitmap which should be replaced by the parent's background (when Opaque = False) or by the Color property value (when Opaque = True).
Event OnStart
Declaration: OnStart: TNotifyEvent;
The OnStart event is triggered if the component has started displaying the animation and the Active (Animate) property is set to True.
Event OnStop
Declaration: OnStop: TNotifyEvent;
The OnStop event is triggered if the component has finished displaying the animation and the Active (Animate) property is set to False (during run-time).
Type TGlyphOrientation
Declaration: TGlyphOrientation = (goHorizontal,
goVertical);
This type defines possible values for Orientation property of a TAnimatedImage component. The value goHorizontal sets horizontal (from left to right) alternation of frames and the value goVertical - vertical (from top to bottom).
Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000