Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Navigation: Subroutines > AUI > AUI_CONTROL > Control Types

Animated Graphics Control

Scroll Prev Top Next More

Animated icons or graphics are typically used to entertain the user during an operation that takes more than a couple of seconds. They are usually stored in AVI files, which internally are made up of multiple frames of a similar image, which when "played", give the impression of a moving image. The example below shows two such frames of an AVI file that presents the appearance of the letter moving from one computer to the other:

ashref_img111                       ashref_img112

Another common example is the "flying files" that appear when transferring a lot of files to the recycle bin. You can acquire such AVI files from various sources on the Internet, or build them yourself with AVI toolkits which are also available on the Internet. Once you have the desired AVI file in hand, you can display it using a standard AUI_CONTROL call with the following particulars:

Set the ctype parameter to 0
Set the winclass parameter to "SysAnimate32"
Set the winstyle parameter to a combination of zero or more of the following flags:

Symbol

Value

Meaning

ACS_CENTER

&h0001

Center the graphic in the specified rectangle; instead of putting it in the upper left corner. (Animated graphics do not scale.)

ACS_TRANSPARENT

&h0002

Use a transparent background. (This is almost always desirable.)

ACS_AUTOPLAY

&h0004

Start the graphic "playing" automatically

 

CTYPE = 0    ! use winclass instead of type

xcall AUI,AUI_CONTROL, CTLOP_ADD,ID,AVIFILE$, MBST_ENABLE, CTYPE, "","",STATUS,SROW,SCOL,EROW,ECOL,-2,-2,0,0,"","",0, "SysAnimate32",ACS_TRANSPARENT+ACS_AUTOPLAY,0

You can stop and start it using the CTLOP_CHG opcode with the special cstate flags MBST_PLAY and MBST_STOP, for example:

xcall AUI,AUI_CONTROL, CTLOP_CHG,ID,"", MBST_STOP

or

xcall AUI,AUI_CONTROL, CTLOP_CHG,ID,"", MBST_PLAY